Nginx 修改名称以及版本号

假设修改nginx名称为xws,需要以下三个步骤

1、修改src/core/nginx.h(Nginx内部名称的)

#define NGINX_VERSION "1.8.0"
#define NGINX_VER "nginx/" NGINX_VERSION

NGINX_VERSION是版本号,NGINX_VER是名称

改为

#define NGINX_VER "xws"

2、修改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: xws" CRLF;

3、修改src/http/ngx_http_special_response.c(修改错误页的底部Footer)

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>xws</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;