nginx安装第三方模块

本文介绍了如何在nginx中添加第三方模块,以增强其功能。通过示例展示了在未安装和已安装nginx情况下安装ngx_cache_purge模块的步骤,并强调了在安装过程中应避免使用`make install`,而是直接覆盖nginx二进制文件。此外,还提到了通过特定第三方模块进行日志打印以辅助排错的需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

nginx增加第三方模块

一、概述
nginx文件非常小但是性能非常的高效,这方面完胜apache。
nginx文件小的一个原因之一是nginx自带的功能相对较少,好在nginx允许第三方模块,第三方模块使得
nginx越发的强大。

nginx已支持动态加载模块

二、安装第三方模块

./configure --prefix=源安装目录 --add-module=/第三方模块解压目录

以安装ngx_cache_purge模块实例
场景一: 在未安装nginx的情况下安装nginx第三方模块

./configure \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_image_filter_module \
--add-module=/nginx_module/ngx_cache_purge \
--add-module=/nginx_module/echo-nginx-module-0.58
make
make install
/usr/local/nginx/sbin/nginx

场景二:在已安装nginx情况下安装nginx模块

/usr/local/nginx/sbin/nginx -V
./configure --prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_image_filter_module \
--add-module=/nginx_module/ngx_cache_purge
make
cp
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值