centos7系统库中默认是没有Nginx的rpm包的,所以我们自己需要先更新下rpm依赖库
(1)使用yum安装Nginx需要包括Nginx的库,安装Nginx的库
#rpm -Uvh http://Nginx.org/packages/centos/7/noarch/RPMS/Nginx-release-centos-7-0.el7.ngx.noarch.rpm
(2)使用下面命令安装Nginx
#yum install Nginx
(3)启动Nginx
#service Nginx start
或
#systemctl start Nginx.service
本文转自:http://www.cnblogs.com/Robert-huge/p/6003934.html