Nginx追加模块

备注:网上有同学说只make不make install,会覆盖,但是Nginx在make install时,会判断文件是否存在,如果存在则不会进行创建和覆盖。

查看Nginx 编译参数

/app/nginx/sbin/nginx -V

追加第三方模块

安装Nginx echo模块

cd /opt/
git clone https://github.com/openresty/[email protected]
cd /opt/nginx-1.8.1
./configure --prefix=/app/nginx-1.8.1 --user=nginx --group=nginx --add-module=/opt/1.8.x/
make && make install

追加自身模块

安装RealIP模块,在有CDN或多层反向代理的情况下,获取用户真实IP

cd /opt/nginx-1.8.1
./configure --prefix=/app/nginx-1.8.1 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module
make && make install

results matching ""

    No results matching ""