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

How to disable server_tokens item in Nginx configuration

WBOY
Release: 2023-05-12 08:37:21
forward
3192 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:
source:yisu.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template