nginx "server_tokens"配置被忽略

标签 nginx

nginx.conf:

server_tokens off;

为什么这会被忽略,仍然发送 header :
Server: nginx

不,其他包含的配置文件不包含 server_tokens配置。

是的,我确实重新启动了所有服务。

最佳答案

引用 the docsserver_tokens指示:

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



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

关于nginx "server_tokens"配置被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20247184/

相关文章:

php - 将我的 Azure 应用服务更改为 PHP 8.1,nginx 不断返回 404

python - 在 Daphne - SSL 上使用 channel 部署 django 应用程序

linux - 为 PHP-FPM 配置 IPtables

nginx - 使用 ffmpeg 转码扩展 nginx-rtmp 直播

c++ - 带有 nginx 代理的 POCO HttpServer

ruby-on-rails - 如何正确诊断 500 错误(Rails、Passenger、Nginx、Postgres)

apache - 如何从网络服务器调用本地 shell 脚本?

python - 通过 UWSGI/NGINX 将参数传递给 Python Flask

docker - Heroku (Docker) nginx 中的 PORT 环境变量

nginx - 如何将 Dokku 应用程序指向 dokku 服务器的根域