隐藏 nginx 服务器响应 header

To hide nginx server response header

我们已经通过 Helm 安装了 Nginx ingress controller。对于我们的应用程序,我们在配置映射中单独维护设置。应用程序运行良好。

出于安全考虑,我们希望在响应中隐藏 NGinx 服务器和版本详细信息 header。

我们进行了很多探索,找到了以下解决方案 -

  1. 关闭 server_tokens。在 NGinx.conf 文件中
  2. 在 AKS 门户的配置映射文件中设置 server-tokens = false。

None 个解决方案当前有效。

有什么想法吗? enter image description here

https://docs.nginx.com/nginx-ingress-controller/configuration/global-configuration/configmap-resource/

ConfigMap 密钥:服务器令牌

说明:启用或禁用 [​​=22=] 指令。此外,使用 NGINX Plus,您可以指定一个自定义字符串值,包括空字符串值,这会禁用“服务器”字段的发射。

默认值:真

也在这里: https://nginx.org/en/docs/http/ngx_http_core_module.html?&_ga=2.233513502.144122095.1596119059-526821336.1596119059#server_tokens