- 安装必备插件
yum -y install gcc automake autoconf libtool make yum install gcc gcc-c++
 - 
yum方式安装openssl、pcre、zlib
yum -y install openssl openssl-devel yum -y install pcre pcre-devel yum -y install zlib zlib-devel
 - 下载安装Nginx(安装目录在/usr/local/nginx,安装ssl模块)
wget http://nginx.org/download/nginx-1.15.0.tar.gz tar -zxvf nginx-1.15.0.tar.gz cd nginx-1.15.0 ./configure --sbin-path=/usr/local/nginx/nginx --with-http_ssl_module make && make install
 - Nginx安全证书生成
openssl genrsa -out privkey.pem 1024/2038 openssl req -new -x509 -key privkey.pem -out server.pem -days 365
 - 启动服务
cd /usr/local/nginx 启动服务 ./nginx 重新加载 ./nginx -s reload 检查服务 ./nginx -t 停止服务 ./nginx -s stop
 - 测试本地是否启动成功,返回带有Welcome to nginx!    的代码即表示启动成功
curl http://192.168.241.129/
 - 关闭防火墙,禁止自启动
service iptables stop chkconfig iptables off
 
来源:https://www.cnblogs.com/yangjiming/p/11518603.html