Traefik shows bad gateway if the backend service is password protected

Hi, I am trying to put ProxySql's web ui behind traefik.

ProxySql web ui is password protected (Basic Auth).

This is my label:

        - "traefik.enable=true"
        - ""
        - "traefik.constraint-label=cloud-public"

        - "traefik.http.routers.proxysql.entrypoints=websecure"
        - "traefik.http.routers.proxysql.rule=Host(``)"
        - "traefik.http.routers.proxysql.tls=true"

        - "traefik.http.routers.proxysql.tls.options=default"
        - "traefik.http.routers.proxysql.tls.certresolver=letsencrypt"
        - ""

The problem is, when I visit, all I get is bad gateway.

I looked at proxysql doc, it seems it cannot be disabled.

So is there a way to configure Traefik so that it will present the username and password dialog instead just return bad gateway?


Hi @Mike-the-one and thanks for your interest in Traefik,

A Bad Gateway error is returned when the proxied service cannot be reached. If your service is password protected Traefik will send back the 401 Unauthorized response from the service to the client. As an example, a Bad Gateway error will be sent if Traefik and the proxied service are not on the same Docker network.

Are you sure that Traefik can reach the proxied service?
Can you share your full configuration and logs?

1 Like