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

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

  1. 下载第三方扩展模块ngx_http_google_filter_module
# cd /data/software/
# git clone https://github.com/cuber/ngx_http_google_filter_module
  1. 查看nginx编译安装时安装了哪些模块
# nginx -V
nginx version: nginx/1.8.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --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

可以看出编译安装使用了--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_substitutions_filter_module是之前编译添加ngx_http_substitutions_filter_module模块时添加

  1. 加入需要安装的模块,重新编译,如这里添加–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,不然就真的覆盖了
  1. 替换nginx二进制文件:(把nginx停止)
# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
# cp ./objs/nginx /usr/local/nginx/sbin/

如果是内置的模块,在第三步骤的时候,直接--with-相关的模块即可,剩下的步骤依旧

nginx编译安装新模块的更多相关文章

  1. Nginx编译安装第三方模块http_substitutions_filter_module2222

    Nginx编译安装第三方模块http_substitutions_filter_module Rming -- 阅读 安装 Http 编译 module filter nginx 模块 >> ...

  2. Nginx编译安装第三方模块http_substitutions_filter_module

    Nginx编译安装第三方模块http_substitutions_filter_module 分类:服务器技术  作者:rming  时间:-- . >>ngx_http_substitu ...

  3. Nginx编译添加新模块

    目录 一.简介与思路 一.简介与思路 当前适用于nginx已经在安装过了,如果没安装过,直接在编译时候添加模块即可. Nginx主要程序就是nginx这个二进制脚本,只要在编译一个nginx脚本替换掉 ...

  4. nginx编译安装配置模块大全

    使用configure命令配置构建.它定义了系统的各个方面,包括允许nginx用于连接处理的方法.最后,它会创建一个Makefile.该configure命令支持以下参数:--help 打印帮助信息. ...

  5. mac下使用opencv编译安装新模块contrib

    opencv-4.0.1 opencv_contrib-4.0.1 提供ippicv下载链接: https://pan.baidu.com/s/1OIJRUqPqAtpMetku8qX36w cont ...

  6. Nginx编译安装lua-nginx-module

    lua-nginx-module 模块可以将Lua的强大功能嵌入NGINX服务器. 下载Nginx源码 如果已安装Nginx,需要查看当前安装版本的编译参数: $ /usr/local/nginx/s ...

  7. 已经编译安装的nginx/tenginx编译增加新模块

    只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...

  8. 原已经安装好的nginx,现在需要添加一个未被编译安装的模块--echo-nginx-module-0.56

    为了测试一个NGINX变量,将NGINX加了一个编译模板echo-nginx-module-0.56. 参照如下文件 1,先看以前NGINX有哪些东东. sbin/nginx -Vnginx vers ...

  9. nginx 编译增加新的模块

    原已经安装好的nginx,现在需要添加一个未被编译安装的模块: nginx -V 可以查看原来编译时都带了哪些参数 原来的参数:--prefix=/app/nginx 添加的参数: --with-ht ...

随机推荐

  1. function&箭头函数

    JS中this到底指向谁? function:谁调用指向谁 var id = '654321' var handler = { id: '123456', init: function() { con ...

  2. uva10082 WERTYU (Uva10082)

    A common typing error is to place the hands on the keyboard one row to the right of the correct posi ...

  3. 第四节:Web爬虫之pyquery解析库

    PyQuery库也是一个非常强大又灵活的网页解析库,如果你有前端开发经验的,都应该接触过jQuery,那么PyQuery就是你非常绝佳的选择,PyQuery 是 Python 仿照 jQuery 的严 ...

  4. PAT 1039. Course List for Student

    Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists o ...

  5. ubuntu16.04安装jdk/mysql/tomcat (使用apt-get命令)

    安装jdk 更新系统安装包缓存,并且安装OpenJDK8 sudo apt-get update sudo apt-get install openjdk-8-jdk 检查jdk版本 java -ve ...

  6. CentOS7版本的新特性

    综述 XFS  比 EXT 4更适合大文件处理,但消耗的CPU资源是EXT4的两倍 XFS 最大支持单文件16TB ,EXT4:50TB 最小1GB/建议每个逻辑CPU 1GB 逻辑CPU:核数,而非 ...

  7. broker监控dataguard配置

    使用broker查看dataguard信息时有告警 DGMGRL> show configuration; Configuration - DRTEST Protection Mode: Max ...

  8. PatentTips - Fair scalable reader-writer mutual exclusion

    BACKGROUND The present invention relates generally to multithreaded programming and, more specifical ...

  9. activeMQ公布订阅模式中中经常使用工具类

    package com.jms; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import javax.j ...

  10. MySQL命令行登陆

    环境介绍 OS:CentOS6.X & Win2003 & Win2008 MySQL版本号:5.5.x 除了经常使用的MySQL管理工具,还有MySQLclient命令行工具经常被用 ...