Nginx动态添加模块
  pBjmnObxvu04 2023年11月12日 85 0

一、Nginx动态添加模块

  这里以安装第三方ngx_http_google_filter_module模块为例

  nginx的模块是需要重新编译nginx,而不是像apache一样配置文件引用.so

  1、下载第三方扩展模块ngx_http_google_filter_module

  找到插件所在位置进行下载

# cd /data/software/
# git clone https://github.com/cuber/ngx_http_google_filter_module

  2、查看nginx编译安装时安装了哪些模块

nginx -V

  3、加入需要安装的模块,重新编译,如这里添加–add-module=/data/software/ngx_http_google_filter_module

# ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --add-module=/data/software/ngx_http_substitutions_filter_module --add-module=/data/software/ngx_http_google_filter_module
# make //千万不要make install,不然就真的覆盖了

  4、替换nginx二进制文件

# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
# cp

 



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月12日 0

暂无评论

推荐阅读
pBjmnObxvu04