Created
December 5, 2018 22:03
-
-
Save nathanpeck/a5d76f1bc0296bf6bf50f6129072cde8 to your computer and use it in GitHub Desktop.
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 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