首页 > 其他 > 详细

nginx第三方模块如何安装?

时间:2021-03-30 09:43:37      阅读:30      评论:0      收藏:0      [点我收藏+]

Nginx 第三方模块:

第三模块是对nginx 的功能扩展,第三方模块需要在编译安装nginx 的时候使用参数--add-module=PATH指定路径添加,有的模块是由公司的开发人员针对业务需求定制开发的,

有的模块是开源爱好者开发好之后上传到github进行开源的模块,nginx支持第三方模块,需要重新编译源码才能支持。

nginx第三方模块安装方法

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

查看已经有的模块    nginx   -V

比如echo模块。

location   /test   {
echo "test here";
}

技术分享图片

 

 没有安装这个echo模块,会有提示报错的

技术分享图片

 

 安装过程,实现输出效果

下载echo模块到nginx安装目录中里

wget https://github.com/openresty/echo-nginx-module/archive/v0.61.tar.gz

解压    tar   -zxvf v0.61.tar.gz

编译  

./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=/usr/local/lnmp1.4-full/src/openssl-1.0.2l --with-http_image_filter_module --add-module=/usr/local/lnmp1.4-full/src/nginx-1.12.2/third_module/echo-nginx-module-0.61

 

nginx第三方模块如何安装?

原文:https://www.cnblogs.com/liuyakai/p/14594748.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!