I get error "404 page not found" after upgrading from traefik from v2.x.x to v3.x..
This error appears only when I'm trying to access dashboard but when I'm using it to access other containers it works fine.
docker-compose.yml
version: "3.9"
services:
traefik:
image: traefik:v3.3.0
container_name: traefik
networks:
- proxy
ports:
- 80:80/tcp
- 443:443/tcp
volumes:
- ./config/traefik.yml:/traefik.yml:ro
- ./config/dynamic.yml:/dynamic.yml:ro
- /docker/logs/traefik:/var/logs/traefik
- ./acme.json:/acme.json
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
security_opt:
- no-new-privileges:true
environment:
- CF_DNS_API_TOKEN=X
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.local.X`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.tls.domains[0].main=local.X"
- "traefik.http.routers.traefik.tls.domains[0].sans=*.local.X"
- "traefik.http.routers.traefik.middlewares=auth@file,default@file"
restart: always
networks:
proxy:
external: true
traefik.yml
global:
checkNewVersion: false
sendAnonymousUsage: false
api:
dashboard: true
debug: false
entryPoints:
web:
address: ":80"
http:
redirections:
entrypoint:
to: websecure
scheme: https
websecure:
address: ":443"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
network: proxy
watch: true
file:
filename: "dynamic.yml"
watch: true
certificatesResolvers:
cloudflare:
acme:
email: ""
storage: "/acme.json"
keyType: RSA4096
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"
log:
level: "DEBUG"
filePath: "/var/logs/traefik/traefik.log"
accessLog:
filePath: "/var/logs/traefik/access.log"
bufferingSize: 100
dynamic.yml
tls:
options:
default:
minVersion: VersionTLS13
sniStrict: true
http:
middlewares:
auth:
basicAuth:
users:
- "x"