Nginx安全选项
安全配置
`在主配置文件的http模块中添加`
http {
.......
server_tokens off;
.......
}
自定义NGINX的Server
`修改代码文件`
[root@svr certs]# vim /usr/local/src/nginx-1.24.0/src/http/ngx_http_header_filter_module.c
#将Server:后面的信息修改为自己想要的
static u_char ngx_http_server_string[] = "Server: tang/v1" CRLF;
`重新编译nginx`
[root@svr nginx-1.24.0]# ./configure --prefix=/apps/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module --with-file-aio --with-threads
#重启服务就可以了
升级 OpenSSL 版本
#准备 OpenSSL 源码包
#重新编译安装 Nginx 并制定新版本 OpenSSL 路径:引用模块 --with-openssl=[OpenSSL路径]
#验证并启动 Nginx: