CentOS7.x
yum install -y gcc
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
wget http://nginx.org/download/nginx-1.14.2.tar.gz
tar -zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0/
./configure --prefix=/usr/local/nginx --pid-path=/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre
make
make install
默认Nginx安装在/usr/local/nginx/中
/usr/local/nginx/sbin/nginx #默认启动方式 start
/usr/local/nginx/sbin/nginx -t #测试配置信息
/usr/local/nginx/sbin/nginx -v #显示版本信息,-V(大V)显示编译时的参数
/usr/local/nginx/sbin/nginx -s stop #快速停止服务
/usr/local/nginx/sbin/nginx -s quit #正常停止服务
/usr/local/nginx/sbin/nginx -s reload #重启