1、安装GCC yum install gcc-c++
2、安装PCRE yum install -y pcre pcre-devel
3、安装ZLIB yum install -y zlib zlib-devel
4、安装OPENSSL yum install -y openssl openssl-devel
5、切换目录(/root/file)下载压缩包 wget https://nginx.org/download/nginx-1.25.2.tar.gz
6、解压缩 tar -zxvf nginx-1.25.2.tar.gz
7、切换到解压后目录 cd nginx-1.25.2
8、配置 ./configure --with-http_ssl_module
9、执行编译安装 make & make install
10、找到安装目录(/usr/local/nginx/conf)下的nginx.conf 配置好后替换它
11、命令语句:
sudo /usr/local/nginx/sbin/nginx
sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx -s reload