修改Nginx的http响应头server字段
修改源码 src/http/ngx_http_header_filter_module.c
修改前:
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 CRLF CRLF;
修改后:
static u_char ngx_http_server_string[] = "Server: X-Web" CRLF;
static u_char ngx_http_server_full_string[] = "Server: X-Web" CRLF;
static u_char ngx_http_server_build_string[] = "Server: X-Web" CRLF;
Nginx安装https模块时,with-openssl 为openssl得源码路径,不是安装之后的路径
./configure --prefix=/opt/local/Nginx --sbin-path=/opt/local/Nginx/sbin/Nginx --pid-path=/opt/logs/Nginx/Nginx.pid --error-log-path=/opt/logs/Nginx/logs/error.log --http-log-path=/opt/logs/Nginx/logs/access.log --with-http_v2_module --with-http_ssl_module --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream_ssl_module --with-stream_realip_module --with-stream_ssl_preread_module --with-http_realip_module --with-openssl=/opt/soft/openssl-3.0.3
其中http_realip_module 为真实ip模块,http_gzip_static_module 为压缩模块
真实ip模块配置如下:
real_ip_header X-Forwarded-For;
set_real_ip_from x.x.x.x;
其中x.x.x.x 为来源ip,比如waf的ip
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。