- 打开Nginx主配置文件:nginx.conf,取消注释或添加配置语句。
- server_tokens off;
http {
# ...省略一些配置
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
server_tokens off; #默认是注释掉的
# ...省略一些配置
}
- 重新加载nginx
nginx -s reload
http {
# ...省略一些配置
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
server_tokens off; #默认是注释掉的
# ...省略一些配置
}
nginx -s reload