Skip to content

Instantly share code, notes, and snippets.

@mreis1
Last active March 28, 2017 16:39
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 mreis1/1a6f2bf4e02682f8bc6856e3995e47e2 to your computer and use it in GitHub Desktop.
Save mreis1/1a6f2bf4e02682f8bc6856e3995e47e2 to your computer and use it in GitHub Desktop.
nginx-configuration-samples
docker-gen is able to generate a nginx configuration
https://github.com/jwilder/docker-gen/blob/master/templates/nginx.tmpl
events {
worker_connections 1024;
}
http{
server {
server_name localhost;
listen 80;
location / {
proxy_pass http://127.0.0.1:8081;
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;
}
location ~ /app2 {
rewrite /app2(.*) /$1 break;
proxy_redirect off;
proxy_pass http://192.168.0.112;
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;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment