让Nginx关闭版本显示信息
让Nginx关闭版本显示信息 篇1
Nginx 会在 http 头,或者出现错误页的时候会有醒目的版本号提示,
为了安全,可以关闭这些信息。
方法很简单,只需在 nginx.conf 的 http { 里头加入 server_tokens 的参数
例如:
[plain]
http {
include mime.types;
default_type application/octet-stream;
server_tokens off; #关闭版本显示
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
使用 curl 工具测试结果如下:
[html]
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Fri, 11 Dec 01:47:53 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Keep-Alive: timeout=20
Location: www.***.cn/index
【让Nginx关闭版本显示信息】推荐阅读:
安装WordPress后系列二:隐藏WordPress版本信息07-31
关闭质量问题案例06-21
项目关闭通知单08-16
信用卡因催收而关闭09-08
2015大安山乡关闭煤矿工作汇报07-17
关闭和开启360安全卫士加速球方法09-08
版本分析05-24
版本差异05-28
最新版本07-12
教学版本07-22