PoC for a generic HTTP proxy for Docker hosts.
http://myapp.example.com:8080 → http://myapp.dev.docker:8080
PoC for a generic HTTP proxy for Docker hosts.
http://myapp.example.com:8080 → http://myapp.dev.docker:8080
| daemon off; | |
| events { | |
| } | |
| http { | |
| server { | |
| listen 8080; | |
| listen 9200; | |
| server_name ~^(?<app_name>[^.]+)\.example\.com$; | |
| resolver 172.17.42.1; | |
| location / { | |
| proxy_pass http://$app_name.dev.docker:$server_port; | |
| ## websocket support | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| } | |
| } | |
| } |
For web apps you can have all your containers bind to port 80 and not worry about port mappings