nginx 502: Debugging Cross-Compose Container DNS Resolution
Service names aren't resolvable across Compose projects — you need to add a network alias so nginx can find the container.
Service names aren't resolvable across Compose projects — you need to add a network alias so nginx can find the container.
Cross-project DNS resolution requires container_name or a network alias — and only aliases support horizontal scaling.
When nginx uses the `set $variable` pattern for dynamic upstreams, the DNS cache expires every 30 seconds — the first request after expiry hits a 502 because no IP is available. Upgrading to nginx 1.27.3 and switching to an upstream block with the resolve parameter fixes this: DNS updates happen asynchronously in the background.
In wrangler.jsonc, use custom_domain: true in routes with only the hostname as the pattern — no /* wildcard