同事整理的问题分享:
要求在nginx上安装ssl模块,nginx版本为1.20.1,因需要安装openssl,我在之前安装nginx时已安装了openssl,版本为3.0.12

因为已经安装了openssl,所以我尝试直接安装

./configure –prefix=/louyu/nginx/nginx_1.28.0 --with-http_ssl_module 出现报错

结果报错了,报错内容是版本不兼容,原因是openssl版本太高,和nginx版本不兼容

有两个方案,一个是降低openssl兼容nginx 一个是升级nginx兼容openssl

因为重装openssl有可能会导致ssh受影响,所以选择升级nginx1.28

tar -zxvf nginx-1.28.0.tar.gz

cd nginx-1.28.0/

./configure –prefix=/louyu/nginx/nginx_1.28.0 --with-http_ssl_module

预编译过后发现

没有使用openssl

手动指定

./configure –prefix=/louyu/nginx/nginx_1.28.0 --with-http_ssl_module –with-openssl=/louyu/nginx/openssl-3.0.12

编译并安装

make && make install

./nginx -V 查看

更多推荐