在nginx配置中禁用server_tokens項
server_tokens在打開的情況下會使404頁面顯示Nginx的當前版本號。這樣做顯然不安全,因為黑客會利用此信息嘗試相應Nginx版本的漏洞。
只需要在nginx.conf中http模塊設置server_tokens off即可,例如:
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; }
重啟Nginx后生效
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END