cd /etc/yum.repos.d
mkdir repo_bak
mv *.repo repo_bak/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
yum install -y epel-release
yum repolist
yum install nginx
systemctl start nginx
在浏览器上输入阿里云你自己服务器的ip地址,访问即可,如下表示启动成功
原文:https://www.cnblogs.com/weiweivip666/p/13907297.html