centos通过yum安装最新版的nginx

1. 安装 epel-release 源

 yum -y install epel-release

2.设置nginx源

vi /etc/yum.repos.d/nginx.repo

//设置内容如下
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

3.安装nginx

yum install nginx -y

你可能感兴趣的:(centos通过yum安装最新版的nginx)