参考:https://www.cnblogs.com/lianzhilei/p/6475025.html
参考:https://blog.csdn.net/naola2001/article/details/8249363
编辑 src/http/ngx_http_header_filter_module.c 的 49-50 行:
static u_char ngx_http_server_string[] = "Server: xOS" CRLF; static u_char ngx_http_server_full_string[] = "Server: xOS" NGINX_VER CRLF; static u_char ngx_http_server_build_string[] = "Server: xOS" NGINX_VER_BUILD CRLF;
编辑 src/core/nginx.h :
#define NGINX_VER "xOS"
修改完后重新编译 nginx ,注意:–with-http_stub_status_module
cd nginx-1.17.4 && ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_v2_module --with-openssl=./openssl-1.0.2t --add-module=./ngx_cache_purge-2.3 --with-http_gzip_static_module --with-http_stub_status_module && make && make install
重启 nginx ,再看 Response Headers 里面 Server 信息,依然显示:server: nginx
实证未遂。