【发布时间】:2012-04-20 15:21:55
【问题描述】:
我想从 http 响应头中删除 Nginx。我可以隐藏我的 Nginx 版本,但我也想隐藏 Nginx。 谢谢
【问题讨论】:
标签: nginx http-headers hide
我想从 http 响应头中删除 Nginx。我可以隐藏我的 Nginx 版本,但我也想隐藏 Nginx。 谢谢
【问题讨论】:
标签: nginx http-headers hide
使用ngx_headers_more 模块 - 请参阅http://wiki.nginx.org/NginxHttpHeadersMoreModule。
它允许您配置任何您想要的任意标头 - 请求标头和响应标头。一旦你安装了它(并因此重新编译了你的 Nginx 版本),使用以下配置:
more_set_headers 'Server: my-server';
或者,如果您根本不需要 Server 标头,则使用以下命令清除它:
more_clear_headers 'Server';
【讨论】: