Nginx Stable
yum install http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm -y
yum update -y
yum install nginx -y
Nginx Mainline
sudo echo "[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/\$basearch/
gpgcheck=0
enabled=1" > /etc/yum.repos.d/nginx.repo
yum update -y
yum install nginx -y
Check nginx
[root@36d00d8fbd5d yum.repos.d]# nginx -v
nginx version: nginx/1.10.2
[root@36d00d8fbd5d yum.repos.d]# nginx -v
nginx version: nginx/1.11.9
If you encounter, “Not using downloaded repomd.xml because it is older than what we have” try “yum clean all”
Source :
Server is powered by Digital Ocean, use my referral link to get $10 bonus.