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; }
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!