Hi,
I'm using docker as provider and starting traefik as container. In the docker-compose file I'm refferencing the "auth" middleware with @file. But I'm getting an error message about not finding the middleware from the file:
level=error msg="middleware \"auth@file\" does not exist" routerName=traefik@docker entryPointName=web-secure
My traefik.yml:
entryPoints:
web:
address: ":80"
web-secure:
address: ":443"
http:
middlewares:
http-redirectscheme:
redirectScheme:
scheme: https
auth:
basicAuth:
users:
- "xxxxxxxx"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedbydefault: false
api:
insecure: true
dashboard: true
certificatesResolvers:
myhttpchallenge:
acme:
httpChallenge:
entryPoint: web
email: "xxxxxxxxx"
storage: "acme.json"
My docker-compose.yml:
version: '3.4'
services:
traefik:
image: traefik:2.0
command: --api.insecure=true --providers.docker
restart: always
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/root/docker/traefik2/traefik.yml:/traefik.yml
- /home/root/docker/traefik2/acme.json:/acme.json
container_name: traefik2
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`xxxxxxxx`)"
- "traefik.http.routers.traefik.entrypoints=web-secure"
- "traefik.http.routers.traefik.tls.certresolver=myhttpchallenge"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=auth@file"
Thanks for help!