nginx“server_tokens”配置被忽略

nginx.conf:

server_tokens off;

为什么会被忽略,标题仍然被发送:

Server: nginx

不,其他配置文件不包含server_tokens配置.

是的,我确实重启了所有的服务.

最佳答案
引用server_tokens指令the docs:

Enables or disables emitting nginx version in error messages and in the “Server” response header field.

根据该文档,因此不会阻止生成Server头,但只能防止添加确切的版本.如果要完全删除服务器头,可以使用the ngx_headers_more module.

dawei

【声明】:丽水站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。