rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
- 查看安装源是否添加成功
yum search nginx
- 安装
yum install -y nginx
- 启动Nginx并设置开机自动运行
systemctl start nginx.service
systemctl enable nginx.service
- 配置
配置文件在’/etc/nginx/nginx.conf’
- 重新加载配置
/usr/sbin/nginx -s reload
- 安装nginx-upstream-fair模块
yum安装nginx后添加nginx-upstream-fair