1、添加源
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2、安装
yum install -y nginx
3、启动
systemctl start nginx
启动Nginx后,报 [emerg] bind() to 0.0.0.0:XXXX failed (13: Permission denied)错误
查看http允许访问的端口
semanage port -l | grep http_port_t
将要启动的端口加入到如上端口列表中
semanage port -a -t http_port_t -p tcp 8311