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
原文:https://www.cnblogs.com/liuyakai/p/14594748.html