Skip to content

Instantly share code, notes, and snippets.

@backroot
Created October 30, 2019 21:41
Show Gist options
  • Save backroot/7c8680ebab7687498eb34455b4b2dbf5 to your computer and use it in GitHub Desktop.
Save backroot/7c8680ebab7687498eb34455b4b2dbf5 to your computer and use it in GitHub Desktop.
Install Nginx for CentOS 7
#!/usr/bin/bash
cat <<\EOF > /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=0
EOF
sudo yum install -y nginx --enablerepo=nginx
sudo systemctl enable nginx
sudo systemctl start nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment