首页 > 其他 > 详细

nginx 隐藏版本信息

时间:2017-11-20 19:50:30      阅读:286      评论:0      收藏:0      [点我收藏+]

1. 编辑 nginx.conf 文件

http {

    include       mime.types;
    default_type  application/octet-stream;
    server_tokens off; #隐藏软件版本信息
...

 

server_token 作用是控制 http response header 内的 web 服务版本信息的显示,以及错误信息中 Web 服务版本信息的显示。

默认情况下,该参数为 server_token on;

2. 测试,重载 nginx

[root@localhost sbin]# ./nginx -t
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful
[root@localhost sbin]# ./nginx -s reload

3. 查看结果

技术分享图片

 

nginx 隐藏版本信息

原文:http://www.cnblogs.com/reycg-blog/p/7867840.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!