如何从http响应头中删除Nginx? [英] How can remove Nginx from http response header?
本文介绍了如何从http响应头中删除Nginx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从http响应标头中删除Nginx.我可以隐藏我的Nginx版本,但我也想隐藏Nginx.谢谢
I want to remove Nginx from http response header. I can Hide my Nginx version but I want to hide Nginx too. Thanks
推荐答案
使用 ngx_headers_more
模块-请参见它允许您配置所需的任意标头-请求标头和响应标头.安装它(并重新编译您的Nginx版本)后,请使用以下配置:
It allows you to configure any arbitrary headers you'd like - both request and response headers. Once you've installed it (and thus recompiled your version of Nginx), use the following configuration:
more_set_headers 'Server: my-server';
或者,如果您根本不需要 Server
标头,请使用以下命令将其清除:
Alternatively, if you don't want a Server
header at all, then clear it using:
more_clear_headers 'Server';
这篇关于如何从http响应头中删除Nginx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文