1、下载nginx安装包
wget -c http://nginx.org/download/nginx-1.24.0.tar.gz
2、 安装nginx所需要的依赖包
yum install -y gcc-c++ zlib zlib-devel openssl openssl-devel pcre pcre-devel
3、解压安装包
tar -zxvf nginx-1.24.0.tar.gz
4、#执行配置脚本 --prefix是指定安装目录
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
5、安装
make && make install
6、启动Nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf