nginx模块添加
下载需要添加的模块
git clone
https://github.com/cuber/ngx_http_google_filter_module
[root@web-nginx ~]# nginx -V
nginx version: nginx/1.20.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --error-log-path=/var/log/nginx/nginx_error.log --http-log-path=/var/log/nginx/nginx_access.log --pid-path=/usr/local/nginx/run/nginx.pid --lock-path=/usr/local/nginx/lock/nginx --with-http_image_filter_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-pcre --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi
添加模块重新编译配置
[root@web-nginx ~]# cd /usr/local/src/nginx-1.20.1
[root@web-nginx nginx-1.20.1]# ./configure
--user=nginx
--group=nginx
--prefix=/usr/local/nginx
--conf-path=/etc/nginx/nginx.conf
--sbin-path=/usr/sbin/nginx
--error-log-path=/var/log/nginx/nginx_error.log
--http-log-path=/var/log/nginx/nginx_access.log
--pid-path=/usr/local/nginx/run/nginx.pid
--lock-path=/usr/local/nginx/lock/nginx
--with-http_image_filter_module
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_gzip_static_module
--with-http_stub_status_module
--with-http_perl_module
--with-mail
--with-mail_ssl_module
--with-pcre
--http-client-body-temp-path=/var/tmp/nginx/client/
--http-proxy-temp-path=/var/tmp/nginx/proxy
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi
--http-scgi-temp-path=/var/tmp/nginx/scgi
–-add-module=/data/software/ngx_http_google_filter_module
[root@web-nginx nginx-1.20.1]# make //不需要make install
[root@web-nginx nginx-1.20.1]# cp /usr/sbin/nginx /usr/sbin/nginx.bak
[root@web-nginx nginx-1.20.1]#
[root@web-nginx nginx-1.20.1]# cp /usr/local/src/nginx-1.20.1/objs/nginx /usr/sbin/nginx
[root@web-nginx ~]# systemctl reload nginx
[root@web-nginx ~]# ss -tunlp |grep nginx
[root@web-nginx ~]# nginx -V