http://nginx.org/download/
http://nginx.org/download/nginx-1.13.7.tar.gz
1.下载tar包
cd /opt/local
wget http://nginx.org/download/nginx-1.13.7.tar.gz
2.一键安装Nginx的四个依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
3.解压Nginx源码压缩包
cd /opt/local
tar -zxvf nginx-1.13.7.tar.gz
4.预编译配置:
进入nginx目录
cd /opt/local/nginx-1.13.7
执行命令
默认安装在/usr/local/nginx
./configure
指定安装目录位置(--prefix:指定安装目录位置)
./configure --prefix=/opt/local/nginx
或者
4.预编译带SSL协议https:
cd /opt/local/nginx-1.