Skip to content

Instantly share code, notes, and snippets.

@gtwalford
Last active August 29, 2015 14:26
Show Gist options
  • Save gtwalford/fb5942b7f4b0da6321da to your computer and use it in GitHub Desktop.
Save gtwalford/fb5942b7f4b0da6321da to your computer and use it in GitHub Desktop.
#Get IP for docker container from hosts file
upstream {{upstreamName}} {
#container name / corresponding to hosts file
server {{containerName}};
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://{{upstreamName}};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
#Add Auth if needed
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/.htpasswd;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment