nginx第三方模块下载地址:

https://www.nginx.com/resources/wiki/modules/

nginx地址下载:

http://nginx.org/en/download.html

nginx版本号:1.8.1

./configure  \                                                                                                                             
    --user=nginx \
    --group=nginx \
    --prefix=/usr/local/myinstall/nginx \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf \
    --pid-path=/var/run/nginx.pid \
    --lock-path=/var/lock/subsys/nginx \
    --with-http_random_index_module \  #从目录中随机选出一个文件作为主页
    --with-http_ssl_module \ #提供https支持
    --with-http_realip_module \ #允许修改请求头客户端的ip地址(X-Real-IP和X-Forwarded-For)

    --with-http_addition_module \ #在客户端请求的文件的开头或者结尾添加额外的内容
    --with-http_sub_module \ #在客户端请求的文件,把某些字符串替换
    --with-http_dav_module \ #扩展了http协议
    --with-http_flv_module \  #搭建flv视频服务器使用的
    --with-http_gzip_static_module \
    --with-http_geoip_module \
    --add-module=/usr/local/src/nginx/nginx-3rd/nginx-module-url \
    --add-module=/usr/local/src/nginx/nginx-3rd/ngx_http_consistent_hash \
    --add-module=/usr/local/src/nginx/nginx-3rd/nginx-upstream-fair \
    --add-module=/usr/local/src/nginx/nginx-3rd/ngx_cache_purge

其中可能报错误,pcre library找不到,下载pcre-devel就可以了

还可能报错误,geoip library找不到,下载geoip-devel就可以了,这个rpm包有可能yum下载找不到,

则需要配置epel源 ,如下

rpm -ivh http://dl.fedoraproject.org/pub/ ... ease-5-4.noarch.rpm

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5

这样源就配置好了




nginx模块:nginx核心模块 + nginx标准http模块(默认全部编译,否则手动指定排除) + nginx可选模块(使用时必须加上相关编译参数--with-http...) +nginx邮件模块 + nginx第三方模块(--add-module=...)