一、创建nginx.repo仓库文件
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
repo文件的配置参考:YUM详解之配置(一):http://www.hangdaowangluo.com/archives/257
二、Yum安装
# yum list | grep nginx nginx.x86_64 1.8.0-1.el6.ngx nginx-debug.x86_64 1.8.0-1.el6.ngx nginx-debuginfo.x86_64 1.8.0-1.el6.ngx nginx-nr-agent.noarch 2.0.0-7.el6.ngx # yum install nginx.x86_64