环境: 已安装nginx

重新添加:–with-http_stub_status_module --with-http_ssl_module
1)进入nginx原文件路径

cd nginx-1.18.0
2)重新编译,添加模块 --with-http_stub_status_module --with-http_ssl_module

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
3)编译 make  #不要 make install

make
4)备份&拷贝

#备份旧程序
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

#拷贝
cp -r objs/nginx /usr/local/nginx/sbin/nginx
5)重启nginx

#重启
/usr/local/nginx/sbin/nginx -s reload
6)检查模块是否加载

/usr/local/nginx/sbin/nginx -V

如下是成功:
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module