-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
sudo yum update -y | ||
sudo yum install -y nginx | ||
|
||
# Create nginx config | ||
sudo tee /etc/nginx/nginx.conf <<'EOF' | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
map $http_host $upstream { | ||
hostnames; | ||
%{ for domain, backend in services_map ~} | ||
${domain} ${backend}; | ||
%{ endfor ~} | ||
} | ||
server { | ||
listen 80; | ||
server_name ${server_name}; | ||
resolver ${dns_resolver_ip}; | ||
location / { | ||
proxy_pass $upstream; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
} | ||
} | ||
EOF | ||
|
||
# Restart NGINX to apply changes | ||
sudo systemctl restart nginx |
This file was deleted.
Oops, something went wrong.
This file contains 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