ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

nginx-在应用程序中发现不必要的Http响应头

nginx-在应用程序中发现不必要的Http响应头

描述:一般是在返回的响应表头中出现了Server键值对

解决方案:

通过headers-more-nginx-module模块将Server去除

https://github.com/openresty/headers-more-nginx-module
./configure --add-module=/usr/local/headers-more-nginx-modulemakemake install
编译完成后,在nginx.conf参数中增加,以移除Server键值对server{more_clear_headers "Server";more_clear_headers "server";
}

测试:

同理,也可以去点别的响应,比如说把Etag去掉

返回列表