1、下载最新SSL安装包,https://www.openssl.org/source/ 查看最新版本

wget -O openssl-1.1.1k.tar.gz https://www.openssl.org/source/openssl-1.1.1k.tar.gz

2、解压ssl安装包

tar -zxf openssl-1.1.1k.tar.gz

3、下载最新nginx安装包,http://nginx.org/en/download.html 查看最新版本

wget http://www.nginx.org/download/nginx-1.19.9.tar.gz

4、解压nginx 安装包


tar -zxvf nginx-1.19.9.tar.gz

5、解压目录执行 ./configure <编译参数> <第三方插件>

编译参数:可以参考当前编译参数,在ngixn 执行文件目录 执行 nginx -V 显示nginx 信息,上面有当前参数配置

第三方插件:地方插件增减 ssl 配置 ,with-openssl 指定的就是之前解压的ssl安装包路径

/configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-openssl=/home/nginx-1.19.9/openssl-1.1.1k --with-http_stub_status_module

6、执行 make(只编译不安装)

7、备份旧版本执行文件

mv nginx nginxold

8、新编译好的nginx 执行文件在objs 目录下,将新编译好的执行文件复制到旧版执行文件目录,执行 nginx -t 进行测试启动 successful 表示测试启动成功

SSL漏洞 443端口 nginx 重新编译指定ssl版本教程

9、平滑重启nginx

nginx -s reload

10、执行 ngxin -V 查看ssl 信息已经切换成最新版,并且nginx 也升级到最新版

SSL漏洞 443端口 nginx 重新编译指定ssl版本教程

标签: nginx, http, ssl, path, openssl, var, 443

相关文章推荐

添加新评论,含*的栏目为必填