描述
blablabla描述,一般是在返回的響應表頭中出現(xiàn)了Server鍵值對,那我們要做的就是移除它,解決方案中提供了nginx的解決方案
解決方案
第一種解決方案
當前解決方案會隱藏nginx的版本號,但還是會返回nginx字樣,如果想再徹底點,參考第二種解決方案
server{
server_tokens off;
}
or
location{
server_tokens off;
}
第二種解決方案
當前方法需要安裝一個插件,所以nginx需要重新編譯一下,也可以拿我編譯好的nginx,編譯版本是centos7 64位
插件:https://github.com/openresty/headers-more-nginx-module
到nginx官網(wǎng)下載nginx后,在編譯時增加--add-module=/path/to/headers-more-nginx-module
記得修改/path/to/headers-more-nginx-module為你下載的插件路徑
wget 'http://nginx.org/download/nginx-1.17.8.tar.gz'
tar -xzvf nginx-1.17.8.tar.gz
cd nginx-1.17.8/
./configure --prefix=/opt/nginx \
--add-module=/path/to/headers-more-nginx-module
make
make install
編譯完成后,在nginx.conf參數(shù)中增加,以移除Server鍵值對文章來源:http://www.zghlxwxcb.cn/news/detail-696621.html
server{
more_clear_headers "Server";
more_clear_headers "server";
}
參考
編譯好的nginx
使用7z壓縮的exe文件,解壓即可
https://www.aliyundrive.com/s/rGr9YQxuhnM
提取碼: 1l0f
nginx server tokens 參數(shù)描述:http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens
插件地址:https://github.com/openresty/headers-more-nginx-module文章來源地址http://www.zghlxwxcb.cn/news/detail-696621.html
到了這里,關于漏洞修復:在應用程序中發(fā)現(xiàn)不必要的 Http 響應頭的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!