标签:version 第一个 head token [] static special efi server
一、隐藏 Nginx 版本号:在http区块中添加 server_tokens off;
二、隐藏 Nginx 软件名
1、修改第一个文件 /usr/local/src/nginx-1.6.3/src/core/nginx.h
#define NGINX_VERSION "1.1.1"
#define NGINX_VER "panzekai/" NGINX_VERSION
2、修改第二个文件 /usr/local/src/nginx-1.6.3/src/http/ngx_http_header_filter_module.c
static char ngx_http_server_string[] = "Server: panzekai" CRLF;
3、修改第三个文件 /usr/local/src/nginx-1.6.3/src/http/ngx_http_special_response.c
static u_char ngx_http_error_full_tail[] =
"<hr><center>" NGINX_VER "(www.dxjun.com)</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;
static u_char ngx_http_error_tail[] =
"<hr><center>panzekai</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;
4、重新编译安装 Nginx
标签:version 第一个 head token [] static special efi server
原文地址:http://www.cnblogs.com/pzk7788/p/6741107.html