您好,Nginx当前已经隐藏了Nginx的版本了,如果需要连Server也要重新自定义,需要修改
/www/server/nginx/src/src/http/ngx_http_header_filter_module.c
中的第49--50行为
- static u_char ngx_http_server_string[] = "Server: dapaoweb" CRLF;
- static u_char ngx_http_server_full_string[] = "Server: dapaoweb" CRLF;
- static u_char ngx_http_server_build_string[] = "Server: dapaoweb" CRLF;
复制代码
编译步骤:
1、进入到Nginx源码目录,并停止当前Nginx:
- cd /www/server/nginx/src && /etc/init.d/nginx stop
复制代码
2、取消之前的makefile
3、进行配置和设置编译选项
- ./configure --user=www --group=www --prefix=/www/server/nginx --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --with-openssl=/www/server/nginx/src/openssl --with-pcre=pcre-8.43 --with-http_v2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --add-module=/www/server/nginx/src/ngx_http_substitutions_filter_module-master --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --add-module=/www/server/nginx/src/nginx-dav-ext-module
复制代码
4、编译并安装
5、启动Nginx
验证:
|