Skip to content
All tags

#dns

4 posts
tech guide

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.

tech guide

Docker DNS Resolution: container_name vs network alias

Cross-project DNS resolution requires container_name or a network alias — and only aliases support horizontal scaling.

tech guide

nginx First Request Always 502, All Subsequent Requests Fine

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.

tech debug

The Correct Way to Bind a Custom Domain in Cloudflare Workers

In wrangler.jsonc, use custom_domain: true in routes with only the hostname as the pattern — no /* wildcard