配置nginx官方yum源

1
2
3
4
5
6
7
[root@nginx ~]# vim /etc/yum.repos.d/nginx.repo

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

安装nginx

1
[root@nginx ~]# yum -y install nginx

查看版本

1
[root@nginx ~]# nginx -V