Nginx调优(一)
Nginx调优(一)
=====================================================
1、修改版本号
#define NGINX_VERSION "1.10.2"
#define NGINX_VER "nginx/" NGINX_VERSION
修改为
#define NGINX_VERSION "8.8.8.8"
#define NGINX_VER "compy/" NGINX_VERSION
2、修改HTTP头信息中的connection字段,防止回显具体版本号
vim src/http/ngx_http_header_filter_module.c
static char ngx_http_server_string[] = "Server: nginx" CRLF;
修改为
static char ngx_http_server_string[] = "Server: compy" CRLF;
3、文件定义了http错误码的返回,有时候我们页面程序出现错误,Nginx会代我们返回相应的错误代码,回显的时候,会带上nginx和版本号
vim src/http/ngx_http_special_response.c
static u_char ngx_http_error_tail[] =
"
<hr /><center>nginx</center>
" CRLF
"" CRLF
"" CRLF
;
修改为
static u_char ngx_http_error_tail[] =
"
<hr /><center>compy</center>
" CRLF
"" CRLF
"" CRLF
;
==============================================================
作者:compy 更新日期:2017-08-20 00:42 Q群:627806889
==============================================================