Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Last active March 21, 2023 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanpeck/1ad2e5f332d77de180045df640894339 to your computer and use it in GitHub Desktop.
Save nathanpeck/1ad2e5f332d77de180045df640894339 to your computer and use it in GitHub Desktop.
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: nginx-ingress
Cpu: 256
Memory: 128
ContainerDefinitions:
- Name: nginx
Image: public.ecr.aws/nginx/nginx:mainline
EntryPoint:
- '/bin/sh'
- '-c'
Environment:
- Name: MY_URL_ENV_VARIABLE
Vale: http://myupstreamhost.com
Command:
- >
echo "
events {
worker_connections 1024;
}
http
{
upstream ingress
{
server $MY_URL_ENV_VARIABLE;
}
server {
listen 8080;
location /
{
proxy_pass http://ingress;
proxy_set_header Host \$host;
proxy_pass_request_headers on;
}
}
}
" > /etc/nginx/nginx.conf &&
exec nginx -g 'daemon off;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment