Hi all, I am new to the forum! I have recently started using Traefik with Docker and I must say it is fantastic! The trouble I am having at the moment is when I apply basic auth middleware to my Traefik dashboard and then go to load the dashboard, it constantly prompts for my the username and password on an endless loop and I can never get to the dashboard. However, it works perfectly fine without the basic auth and I can load my dashboard just fine. Please can anyone help with this? It has been driving me crazy for the last few days. Please see my samples below. (Note for the password hash I have tried both with and without an extra dollar sign at the beginning and neither work). Thank you in advance.
My Docker Compose file:
version: '3'
services:
traefik:
image: "traefik:v2.2"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/user/traefik/traefik.yml:/etc/traefik/traefik.yaml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.com`)"
- "traefik.http.routers.api.entrypoints=insecure"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.middlewares=api-auth"
- "traefik.http.middlewares.api-auth.basicauth.users=admin:$..."
networks:
default:
external:
name: "web"
My Traefik.yml file
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
network: "web" # Custom docker network
exposedByDefault: false
entryPoints:
insecure:
address: ":80"
secure:
address: ":443"
api:
dashboard: true