星空网 > 软件开发 > Java

修改nginx版本名称伪装任意web server

如何修改nginx默认的名称,可以稍微的伪装一下,也可以装x

一般来说修改3个位置,一个是nginx.h、另一个是ngx_http_header_filter_module.c、还有一个ngx_http_special_response.c。

提示:一般修改都是在nginx编译之前修改,修改完了之后需要重新编译

scr/core/nginx.conf

#define NGINX_VERSION   "1.4.7"#define NGINX_VER     "nginx/" NGINX_VERSION

修改为:(其实版本号也可以随意修改)

#define NGINX_VERSION   "1.4.7"#define NGINX_VER     "jdws/" NGINX_VERSION

其实修改上面一个大部分就会生效!!!

 

/src/http/ngx_http_header_filter_module.c (HTTP ResponseHeader)

static char ngx_http_server_string[] = "Server: nginx" CRLF;

修改为:

static char ngx_http_server_string[] = "Server: jdws" CRLF;

 

/src/http/ngx_http_special_response.c 

static u_char ngx_http_error_tail[] ="<hr><center>nginx</center>" CRLF"</body>" CRLF"</html>" CRLF

修改为:

static u_char ngx_http_error_tail[] ="<hr><center>jdws</center>" CRLF"</body>" CRLF"</html>" CRLF

 

除了随意修改版本号之外,还可以隐藏版本号:

修改nginx.conf

在http{}加入

http{   server_tokens off; }

就可以隐藏版本号了。

 

注意:

关掉了server_tokens之后,nginx.conf配置的东西会无效,回去寻找刚才我们第二步和第三步的配置

未隐藏版本号:

修改nginx版本名称伪装任意web server隐藏版本号:

修改nginx版本名称伪装任意web server基本ok啦啦啦啦

 




原标题:修改nginx版本名称伪装任意web server

关键词:web

web
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

怎样才能KO恶意差评?这套组合拳拿去!:https://www.ikjzd.com/articles/128894
怎样才能KO恶意差评?这套组合拳拿去!:https://www.ikjzd.com/articles/128895
11月才是销量高峰!T恤,还是黑色卖得多!:https://www.ikjzd.com/articles/128897
2018年12月亚马逊英国站台式化妆镜(Countertop Vanity Mirrors)数据报告:https://www.ikjzd.com/articles/12890
遭到恶意投诉怎么办,如何有效应对专利投诉?:https://www.ikjzd.com/articles/128900
“货里藏刀”警告!不靠谱货代频频出错,卖家向谁问责?:https://www.ikjzd.com/articles/128903
长治婚庆女司仪和主持人:https://www.vstour.cn/a/366176.html
北京丰台区水上乐园哪家好玩?:https://www.vstour.cn/a/366177.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流