下载对应当前系统版本的Nginx包(package)
# wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
# wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
建立Nginx的yum仓库
# rpm -ivh Nginx-release-centos-7-0.el7.ngx.noarch.rpm
#rpm -ivh Nginx-release-centos-6-0.el6.ngx.noarch.rpm
下载并安装Nginx
# yum install Nginx
启动Nginx服务
systemctl start Nginx
配置
默认的配置文件在 /etc/Nginx 路径下,使用该配置已经可以正确地运行Nginx;如需要自定义,修改其下的 Nginx.conf 等文件即可。
测试