Nginx隐藏版本及错误信息

Nginx隐藏版本及错误信息

操作步骤如下:

1
2
3
4
[root@localhost nginx-1.12.1]# vim src/core/nginx.h

#define NGINX_VERSION "1.12.1"
#define NGINX_VER "NGINX/" NGINX_VERSION
1
2
[root@localhost nginx-1.12.1]# vim src/http/ngx_http_header_filter_module.c 
static char ngx_http_server_string[] = "Server: nginx" CRLF;
1
2
3
4
[root@localhost nginx-1.12.1]# vim src/http/ngx_http_special_response.c 
"<hr><center>nginx</center>" CRLF
"</body>" CRLF
"</html>" CRLF
-------------本文结束感谢您的阅读-------------
LiGuanCheng wechat
如有问题,请与我微信交流或通过右下角“daovoice”与我联系~。
请我喝一杯咖啡~