Created
December 21, 2020 17:17
-
-
Save caike/b65c1d8c2ad2a71da20ac329d74eb66f to your computer and use it in GitHub Desktop.
Install nginx on Amazon Linux 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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