I want to enable HTTP Basic Auth on a number of Docker containers with Traefik labels. I'm doing it like so:
pgadmin:
labels:
- traefik.enable=true
# make accessible via my.host.com/pgadmin/...
- traefik.http.routers.pgadmin.rule=(Host(`my.host.com`) && PathPrefix(`/pgadmin`))
# HTTPS only
- traefik.http.routers.pgadmin.entrypoints=https
- traefik.http.routers.pgadmin.tls.certresolver=le
# compression middleware
- traefik.http.middlewares.my-compress.compress=true
# basic auth middleware
- traefik.http.middlewares.admin-auth.basicauth.users=admin:$$apr1$$ur5Gr99C$$f354Cu/lqKJYOv5M/eNdW0
# apply middlewares to route
- traefik.http.routers.pgadmin.middlewares=my-compress@docker,admin-auth@docker
And the middleware(s) don't seem to work! I can still browse to my.host.com/pgadmin and see no authentication.