Nginx更改源码隐藏软件名称

来源:互联网 发布:儿童dna数据库有用吗 编辑:程序博客网 时间:2024/06/06 01:31

更改源码隐藏软件名称

使用yum版本安装的话,你是不能来隐藏我们的软件名称的,但是版本号是可以隐藏的!

一般来说修改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