1、首先下載對應最新版nginx
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2、然後就是建立yum倉庫
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
3、解除安裝系統原有的舊版的nginx
yum remove nginx
4、下載安裝nginx
yum install nginx
5、啟動nginx
systemctl start nginx