Nginx设置Header头信息 headers-more-nginx-module

      Nginx 使用 ngx_headers_more 模块来增加、删除出站、入站的 Header 信息。

ngx_headers_more 项目主页

默认该模块没有加入到 Nginx 的源码中,要想使用相关功能需要在编译 Nginx 时加入该模块。

本人服务器中的 Nginx 在编译时没有加入该模块,使用 -V 查看当前 Nginx 的编译参数:

从官网下载模块:

重新编译 Nginx 前,请求 www.z-dig.com 的 Header 信息:

现在重新编译 Nginx ,平滑更新:

到此 Nginx 已重新编译并平滑升级成功。

在 Nginx 的配置文件中加入代码,将之前请求网站返回 Header 中的 X-Powered-By 和 WP-Super-Cache 删除:

 

再次请求查看效果:

猜你喜欢

转载自hugoren.iteye.com/blog/2384427