注意:安装的用户必须要有root权限
1.添加yum nginx repository库
yum install epel-release
2.install nginx
yum install nginx
3. 启动nginx
systemctl start nginx
4.防火墙添加http和https 访问
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd--permanent--add-port=80/tcp
firewall-cmd --reload
5.访问http://ip 测试是否安装成功