安装epel-release源并进行安装
yum install epel-release
yum update(时间会有点长)
yum install nginx

相关操作:
systemctl status nginx #查看运行状态systemctl start nginx #启动systemctl stop nginx #停止systemctl restart nginx #重启systemctl enable nginx #开机启动
设置防火墙
在启动完以后可能无法通过IP访问,需要进一步设置防火墙
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=httpsfirewall-cmd --reload