1、已经安装好的nginx,需要添加一个未被编译安装的模块,以安装第三方ngx_http-google_filter_module模块为例
#cd /tmp/
#pkill nginx
#wget https://nginx.org/download/nginx-1.16.0.tar.gz
#tar xfz nginx-1.16.0.tar.gz
#cd nginx-1.16.0/
#./configure --prefix=/usr/local/nginx --with-http_gzip_static_module && make && make install
2、 下载第三方扩展模块
#cd /tmp/
#git clone https://github.com/cuber/ngx_http_google_filter_module #先安装git
3、查看nginx编译安装以安装模块
#cd /tmp/
#git clone https://github.com/cuber/ngx_http_google_filter_module #先安装git
15.2、查看nginx编译安装以安装模块
#cd /usr/local/nginx/sbin/
#./nginx -v //查看版本
#./nginx -V //查看以安装模块
加入需要安装的模块,重新编译,如这里添加-add-module=/data/software/ngx http_google_filter_module
#cd /tmp/nginx-1.16.0/
#./configure --prefix=/usr/local/nginx \
–error-log-path=/var/log/nginx/nginx_error.log
–http-log-path=/var/