Home > Operation and Maintenance > Nginx > How to disable server_tokens item in Nginx configuration

How to disable server_tokens item in Nginx configuration

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-12 08:37:21
forward
3261 people have browsed it

Disable the server_tokens item in Nginx configuration

When server_tokens is turned on, the 404 page will display the current version number of Nginx. This is clearly unsafe as hackers could use this information to try vulnerabilities in the corresponding Nginx version.

You only need to set server_tokens off in the http module in nginx.conf, for example:

server { listen 192.168.0.25:80; Server_tokens off; server_name tecmintlovesnginx.com www.tecmintlovesnginx.com; access_log /var/www/logs/tecmintlovesnginx.access.log; error_log /var/www/logs/tecmintlovesnginx.error.log error; root /var/www/tecmintlovesnginx.com/public_html; index index.html index.htm; }
Copy after login

It will take effect after restarting Nginx

The above is the detailed content of How to disable server_tokens item in Nginx configuration. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template