wget http://nginx.org/download/nginx-1.18.0.tar.gz #下载
yum -y install gcc-c++ ncurses-devel cmake make perl autoconf automake zlib libxml libgcrypt libtool bison libtirpc-devel openssl-devel #依赖
tar zxvf nginx-1.18.0.tar.gz #解压
cd nginx-1.18.0 #切换目录
useradd -M -s /sbin/nologin nginx #创建用户
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --user=nginx --group=nginx #安装
make -j3 && make install
cd /usr/local/nginx
sbin/nginx #启动
netstat -ntpl | grep nginx #查看是否启动成功
ps -ef | grep nginx