nginx模块添加
2021/8/19 7:07:43
本文主要是介绍nginx模块添加,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
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
这篇关于nginx模块添加的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-17Nginx实用篇:实现负载均衡、限流与动静分离
- 2024-08-21宝塔nginx新增8022端口方法步骤-icode9专业技术文章分享
- 2024-08-21nginx配置,让ws升级为wss访问的方法步骤-icode9专业技术文章分享
- 2024-08-15nginx ws代理配置方法步骤-icode9专业技术文章分享
- 2024-08-14nginx 让访问带有/relid的地址返回404 ,例子 /relid-x-0.36-y-131.html-icode9专业技术文章分享
- 2024-08-14nginx 判断地址有/statics/的路径,指向到/home/html/statics/目录-icode9专业技术文章分享
- 2024-07-24解锁Nginx日志的宝藏:GoAccess——你的实时、交互式Web日志分析神器!
- 2024-03-29fail2ban nginx
- 2024-03-18install nginx proxy manager
- 2024-01-2444从零开始用Rust编写nginx,命令行参数的设计与解析及说明