--- nginx-1.11.10/src/http/ngx_http_header_filter_module.c +++ nginx-1.11.10/src/http/ngx_http_header_filter_module.c.new @@ -46,9 +46,9 @@ }; -static u_char ngx_http_server_string[] = "Server: nginx" CRLF; -static u_char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF; -static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF; +static u_char ngx_http_server_string[] = ""; +static u_char ngx_http_server_full_string[] = ""; +static u_char ngx_http_server_build_string[] = ""; static ngx_str_t ngx_http_status_lines[] = { @@ -276,10 +276,10 @@ if (r->headers_out.server == NULL) { if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { - len += sizeof(ngx_http_server_full_string) - 1; + len += sizeof(ngx_http_server_full_string) - 0; } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) { - len += sizeof(ngx_http_server_build_string) - 1; + len += sizeof(ngx_http_server_build_string) - 0; } else { len += sizeof(ngx_http_server_string) - 1; --- nginx-1.11.10/src/http/ngx_http_special_response.c +++ nginx-1.11.10/src/http/ngx_http_special_response.c.new @@ -19,21 +19,21 @@ static u_char ngx_http_error_full_tail[] = -"
" NGINX_VER "
" CRLF +"
127.0.0.1
" CRLF "" CRLF "" CRLF ; static u_char ngx_http_error_build_tail[] = -"
" NGINX_VER_BUILD "
" CRLF +"
1.0.0
" CRLF "" CRLF "" CRLF ; static u_char ngx_http_error_tail[] = -"
nginx
" CRLF +"
localhost
" CRLF "" CRLF "" CRLF ; --- nginx-1.11.10/src/http/v2/ngx_http_v2_filter_module.c +++ nginx-1.11.10/src/http/v2/ngx_http_v2_filter_module.c.new @@ -236,16 +236,7 @@ clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); if (r->headers_out.server == NULL) { - - if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { - len += 1 + nginx_ver_len; - - } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) { - len += 1 + nginx_ver_build_len; - - } else { - len += 1 + sizeof(nginx); - } + len += 1 + sizeof(nginx); } if (r->headers_out.date == NULL) {