【发布时间】:2020-02-05 12:47:40
【问题描述】:
我想在 Nginx 的 HTTP 400 错误 HTML 错误页脚中隐藏服务器签名。实现Headers-more 模块后。请求 HTTP 包时更改服务器签名:
>> curl -I localhost
输出
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://www.abshnb.com/
Server: Abshnb
但是 HTTP 400 错误 HTML 页面仍然返回带有“nginx”页脚的错误页面。
【问题讨论】:
-
您尝试过error_page 指令吗?不幸的是,“nginx”字在默认错误页面中是硬编码的:github.com/nginx/nginx/blob/…
-
是的,我用过它,但它没有用。我要更改的错误是 400。
标签: nginx http-headers