1,nginx.org网站下载需要的源码包
Nginx官网提供了三个类型的版本
Mainline version:Mainline 是 Nginx 目前主力在做的版本,可以说是开发版
Stable version:最新稳定版,生产环境上建议使用的版本
Legacy versions:遗留的老版本的稳定版
wget http://nginx.org/download/nginx-1.16.1.tar.gz
2,编译
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx.pid --group=www --user=www --with-poll_module --http-proxy-temp-path=/var/tmp/proxy_temp --http-fastcgi-temp-path=/var/tmp/fastcgi_temp --http-uwsgi-temp-path=/var/tmp/uwsgi_temp --http-scgi-temp-path=/var/tmp/cgi_temp --http-client-body-temp-path=/var/tmp/client_body_temp --http-log-path=/var/log/access.log --error-log-path=/var/log/error.log --with-pcre
make
make install