1、下载文件
wget http://nginx.org/download/nginx-1.20.1.tar.gz
tar -zxvf nginx-1.20.1.tar.gz
cd nginx-1.20.1/
2、安装依赖
yum -y install gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel automake autoconf libtool make
3、编译安装
./configure --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-http_ssl_module
make && make install
4、启动Nginx
cd /usr/local/nginx/
cd sbin/ && ./nginx
#重启Nginx
nginx -s reload