Nginx optimization of Web optimization [hide Web name and version number]
Hide Web name and version number
1) Information disclosure:
[Email protected] ~]# curl-i http://www.etiantian.org/sd http/1.1 404 Not FOUND server:nginx/1.2.9 #未隐藏版本号 date:wed, Oct 15:57:08 GMT content-type:text/html connection:keep-alive vary:accept- Encoding
2) Workaround:
[[email protected] nginx-1.6.2]# sed -n ' 13,17p ' src/core/nginx.h
#define Nginx_version "2.4.2" #define Nginx_ver "nginx/" nginx_version #define NGINX_VAR "old Boy_server "#define Ngx_oldpid_ext". Oldbin "
[[email protected] application]# Find/-type f-name "ngx_http_special_response.c" /server/tools/nginx-1.6.3/src/http/ngx_http_special_response.c |
[Email protected] nginx-1.6.2]# sed-n 49p src/http/ngx_http_header_filter_module.c
static char ngx_http_server_string[] = "Server:oldboy_server" CRLF;
[Email protected] nginx-1.6.2]# sed-n ' 21,29p ' src/http/ngx_http_special_response.c
Static U_char ngx_http_error_full_tail[] = "
Static U_char ngx_http_error_tail[] = "
This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1705060
Nginx optimization of Web optimization [hide Web name and version number]