Skip to content

Instantly share code, notes, and snippets.

@caike
Created December 21, 2020 17:17
Show Gist options
  • Save caike/b65c1d8c2ad2a71da20ac329d74eb66f to your computer and use it in GitHub Desktop.
Save caike/b65c1d8c2ad2a71da20ac329d74eb66f to your computer and use it in GitHub Desktop.
Install nginx on Amazon Linux 2
#!/bin/bash -xe
yum update -y
amazon-linux-extras install nginx1 -y
cd /usr/share/nginx/html
echo "WebServer on instance-id " > index.html
curl http://169.254.169.254/latest/meta-data/instance-id >> index.html
systemctl start nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment