nginx官方提供的yum原地址:
http://nginx.org/packages/
如果使用centos7,则找到源地址,然后使用命令:
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
然后使用yum开始安装:
sudo yum install -y nginx
// 设置开机自启动
sudo systemctl start nginx.service
sudo systemctl enable nginx.service