1、安裝nginx必須的依賴包
[root@web01 ~]# yum -y install openssl-devel pcre-devel zlib-devel
2、安裝官方yum源
[root@web01 ~]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
3、安裝nginx
[root@web01 ~]# yum -y install nginx