查看nginx当前安装所带参数
执行nginx -V
nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2l 25 May 2017
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/data/my/lnmp/lnmp1.4/src/openssl-1.0.2l --with-google_perftools_module
下载subs_filter模块
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
添加新模块并编译
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module --with-openssl=/data/my/lnmp/lnmp1.4/src/openssl-1.0.2l --with-google_perftools_module --add-module=ngx_http_substitutions_filter_module
make
注意:这里不需要make install
替换老的nginx文件为新的nginx文件
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx_old
cp objs/nginx /usr/local/nginx/sbin/
最新评论