查看nginx安装的模块
/usr/local/nginx/sbin/nginx -V
若出现“–with-http_ssl_module”说明已经安装过,否则继续执行下列步骤
进入nginx源文件目录
cd /usr/local/nginx/nginx-1.20.2
重新编译nginx
./configure --with-http_ssl_module
如果组件linux缺少,参考如下
OpenSSL library错误
https://blog.csdn.net/weixin_44371237/article/details/135841121
PCRE library错误
https://blog.csdn.net/weixin_44371237/article/details/135840880
再执行如下命令(这里一定不要执行make install,否则会覆盖掉原来的nginx)
make
用新的nginx覆盖旧的(会多一个objs文件夹)
停止nginx服务
/usr/local/nginx/sbin/nginx -s stop
执行覆盖命令(先停止nginx,./nginx -s stop)
cp /usr/local/nginx/nginx-1.20.2/objs/nginx /usr/local/nginx/sbin
nginx启动
/usr/local/nginx/sbin/nginx