Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Created December 5, 2018 22:03
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/a5d76f1bc0296bf6bf50f6129072cde8 to your computer and use it in GitHub Desktop.
Save nathanpeck/a5d76f1bc0296bf6bf50f6129072cde8 to your computer and use it in GitHub Desktop.
# This is a Nginx sidecar. This is needed because Consul Connect proxy
# binds to localhost and doesn't accept direct traffic from the public.
# This Nginx container does though and can serve as a proxy to the proxy.
- Name: !Sub ${ServiceName}-nginx
Image: nginx
EntryPoint:
- '/bin/sh'
- '-c'
Command:
- >
echo '
events {
worker_connections 1024;
}
http
{
upstream ingress
{
server localhost:3000;
}
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;'
Essential: true
PortMappings:
- ContainerPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment