OpenResty 清除 Sever 头信息

OpenResty HTTP About 292 words

需求

HTTP返回的Header中不带Server字段。

方式

使用OpenResty自带并默认开启的headers-more-nginx-module模块清除Header信息。在配置文件中添加以下代码,作用域:httpserverlocationlocation if

more_clear_headers 'Server';

备注

不能清除Connection的返回头信息。

headers-more-nginx-module模块还可用来设置其他头信息。

文档

https://github.com/openresty/headers-more-nginx-module

Views: 3,992 · Posted: 2020-10-04

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh