// 002 · 2026-07-10 · docker · traefik · debugging

Gateway Timeout: when Traefik guesses the wrong Docker network

Hours after this stack went live, n8n.svbk.dev started returning Gateway Timeout. The container was up. Logs clean. Memory fine. It had even served traffic earlier.

The setup

Each service here sits on two Docker networks: an internal one (to reach Postgres and each other) and the shared coolify network (to reach the Traefik reverse proxy). That's a normal pattern — and it hides a trap.

The trap

When Traefik's Docker provider builds a route to a container, it has to choose which of the container's IPs to proxy to. If you don't tell it which network to use, it guesses. It guessed right at first. Then an unrelated redeploy made it re-evaluate, and it picked the internal IP — one Traefik can't reach. Timeout, with every component individually healthy.

The fix

One label, pinning the choice:

labels:
  traefik.enable: "true"
  traefik.docker.network: coolify

If a container is attached to more than one network, this label is not optional — it just hasn't bitten you yet. The failure mode is nasty precisely because it's intermittent: it survives restarts, then flips on some unrelated event that makes the proxy re-enumerate networks.

Debugging path that got there: container healthy → proxy timing out → therefore the problem is between them. Everything between them is: which IP the proxy dialed.

← all entries · get these in your inbox