Network error as Response

Hi everyone,

I’m running Traefik in front of several containers.

I need Traefik to return a network error to the client if a route (or the container behind it) doesn’t respond or isn’t reachable. Is this possible to configure in the Traefik container?

What I’ve tried:

  • Using Docker labels → I get 404 Route not found, which is expected.

  • Defining the router and service via file → when the backend container stops, Traefik returns 502 Bad Gateway.

Is there another way to make the client see a network error (not an HTTP status like 404/502)? I need this for a redundancy check in another piece of software that only fails over when the HTTPS connection terminates with a network error.

Thanks!