wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
mkdir /tools
cd /tools
wget http://nginx.org/download/nginx-1.12.1.tar.gz
yum install pcre pcre-devel openssl-devel -y
useradd nginx -s /sbin/nologin -M
tar xf nginx-1.12.1.tar.gz
cd nginx-1.12.1
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx1.12.1 --with-http_stub_status_module --with-http_ssl_module
make && make install
ln -sv /usr/local/nginx1.12.1/ /usr/local/nginx
echo "export PATH=$PATH:/usr/local/nginx/sbin" >>/etc/profile
source /etc/profile
echo /usr/local/nginx/sbin/nginx >>/etc/rc.local
nginx -t && nginx