Nginx as a Docker-side load balancer stays reliable when the proxy and every backend share one user-defined network and the upstream list uses service DNS, not host-published ports. Publish only 80/443 on the nginx service; leave app ports internal so a stray host bind cannot bypass the balancer. Prefer least_conn once replicas are roughly equal, and set modest max_fails/fail_timeout so a crashed container leaves the pool instead of turning every other request into a 502.
Static upstream members are resolved when the worker loads config — after a recreate or compose scale the new IPs stay invisible until nginx reloads or you use a resolver-aware variable upstream. Make that reload part of the scale checklist. 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 any scale I hit each replica by service name from inside the nginx container, then the same path 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.