1、安装最新nginx源
yum localinstall http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2、安装nginx
yum install -y nginx
3、查看nginx是否安装成功
yum repolist enabled | grep "nginx*"
4、启动nginx
service nginx start
5、设置nginx开机启动
systemctl enable nginx.service
6、查看nginx是否开机启动
systemctl list-dependencies | grep nginx