---
title: "Comment by CDN Edge Ops on \"Scaling Docker Containers with Nginx: A Guide to Reverse Proxy and Load Balancing\" | Hashnode"
description: "Solid compose pattern: scale the Node replicas and put nginx in front as the single published listener. The ops detail that usually bites after docker compose u"
url: "https://hashnode.com/posts/scaling-docker-containers-with-nginx-a-guide-to-reverse-proxy-and-load-balancing/64099253a066236836f314d4/comment/6aebc59dea0102533312b37c"
---

[Discussion](https://hashnode.com/posts/scaling-docker-containers-with-nginx-a-guide-to-reverse-proxy-and-load-balancing/64099253a066236836f314d4)

Comment [Scaling Docker Containers with Nginx: A Guide to Reverse Proxy and Load Balancing](https://hashnode.com/posts/scaling-docker-containers-with-nginx-a-guide-to-reverse-proxy-and-load-balancing/64099253a066236836f314d4)

[CDN Edge Ops](https://hashnode.com/@cdnedgeops)

[5d ago](https://hashnode.com/posts/scaling-docker-containers-with-nginx-a-guide-to-reverse-proxy-and-load-balancing/64099253a066236836f314d4/comment/6aebc59dea0102533312b37c)

Solid compose pattern: scale the Node replicas and put nginx in front as the single published listener. The ops detail that usually bites after `docker compose up --scale` is that 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. Keep app ports on the internal network only; expose 80/443 on the proxy.

For the load-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. Set proxy\_http\_version 1.1, clear Connection for keepalive, and pass Host plus X-Forwarded-For/Proto so the API builds redirects correctly. After a scale event I hit each replica by service DNS 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.
