如何隐藏nginx版本号

vi /etc/nginx/nginx.conf

配置文件中,http区段中插入“server_tokens  off;”,重新载入配置文件

worker_processes  1;
 
events {
    worker_connections  1024;
}
 
http {
    include       mime.types;
    default_type  application/octet-stream;
    server_tokens  off;
    expires         5s;
    sendfile        on;

重载nginx配置文件

nginx -t
nginx -s reload

 

修改前

修改后

原文地址:https://www.cnblogs.com/caidingyu/p/10782453.html