环境:CentOS release 6.10 (Final)
1.1 配置nginx官方源(推荐)
[root@instance-2 ~]# vim /etc/yum.repos.d/nginx.repo
复制如下内容:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
1.2 yum安装nginx
[root@instance-2 ~]# yum list | grep nginx
[root@instance-2 ~]# yum install nginx
1.3 查看版本
[root@instance-2 nginx-1.13.6]# nginx -v
nginx version: nginx/1.16.0
安装完毕
centos 安装 nginx