Passionate about Cloud and DevOps engineering. I write structured technical notes and beginner-friendly articles on AWS, Linux, CI/CD, networking, system architecture and modern software delivery workflows.
Compose plus an nginx upstream is the right shape for a multi-container demo that actually survives a scale event: put every app replica and the proxy on one user-defined network, publish only 80/443 on nginx, and name upstream members by service DNS instead of host-published ports. After compose up --scale, a static upstream block only learns peers at reload — new container IPs from a recreate stay invisible until nginx reloads or you use a resolver-aware variable upstream, so treat that reload as part of the scale checklist, not an afterthought.
For the balancer side I prefer least_conn once replicas are roughly equal, with modest max_fails/fail_timeout so a crashed task leaves the pool instead of 502-ing every other request. Pin proxy_http_version 1.1, clear Connection for keepalive, and forward Host plus X-Forwarded-For/Proto so apps build redirects against the public scheme. After a scale or Hub pull I hit each replica by service name from inside the nginx container, then through the public vhost, and compare status and latency — mismatches almost always mean a stale upstream list or a trailing-slash join, not the image tag on Docker Hub.
CDN Edge Ops
Compose plus an nginx upstream is the right shape for a multi-container demo that actually survives a scale event: put every app replica and the proxy on one user-defined network, publish only 80/443 on nginx, and name upstream members by service DNS instead of host-published ports. After
compose up --scale, a static upstream block only learns peers at reload — new container IPs from a recreate stay invisible until nginx reloads or you use a resolver-aware variable upstream, so treat that reload as part of the scale checklist, not an afterthought.For the balancer side I prefer least_conn once replicas are roughly equal, with modest max_fails/fail_timeout so a crashed task leaves the pool instead of 502-ing every other request. Pin proxy_http_version 1.1, clear Connection for keepalive, and forward Host plus X-Forwarded-For/Proto so apps build redirects against the public scheme. After a scale or Hub pull I hit each replica by service name from inside the nginx container, then through the public vhost, and compare status and latency — mismatches almost always mean a stale upstream list or a trailing-slash join, not the image tag on Docker Hub.