1、创建文件
#2、编辑Nginx安装yum
``` cat /etc/yum.repos.d/nginx.repo << EOF
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
EOF
3、安装nginx
sudo yum install nginx
4、启动
sudo service nginx start
5、关闭防火墙
systemctl stop firewalld.service
6、禁用防火墙
systemctl disable firewalld.service