Hi Folks,
I new to Traefik, i manage to configure latest version of Traefik in my Docker lab, i would like to set authentication for Traefik dashboard but it is not working for me. I am using below docker-compose file, i might be using wrong labels as i am not sure which exact labels to be used to setup authentication. Could you please suggests correct procedure to enable authentication for dashboard ...
version: '3.7'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.1
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker --api.dashboard=true --log.level=ERROR --metrics.datadog=true --providers.docker.exposedbydefault=false --metrics.datadog.address=localhost:8125 --metrics.datadog.addentrypointslabels=true --log.format=json --accesslog.format=json --accesslog=true
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.enable: true"
- "traefik.http.routers.dashboard.rule: Host(`192.168.1.14`)"
- "traefik.http.routers.dashboard.rule: PathPrefix(`/dashboard`) || PathPrefix(`/api`)"
- "traefik.http.routers.dashboard.entrypoints: api"
- "traefik.http.routers.dashboard.middlewares: auth"
- "traefik.http.routers.dashboard.service: api@internal"
- "traefik.http.middlewares.admin-auth.basicauth.users=admin:$$apr1$$x7A0C9gd$$wVN4Ve7H5SLsaMVwH2olO/"