Dashboard 404 with Traefik v2.4.2 (Docker)

New user here, I might be misinterpreting the guides, but so far I can't seem to get the dashboard to work.

The problem
I have made sure to request my dashboard at http://subdomain.mywebsite.com/dashboard/ (including the trailing slash).
I am automatically redirected to https, the Let's Encrypt certificate is installed and shown correctly but I am presented with a HTTP 404 instead of a dashboard. A prompt for basic auth is not shown.
I am running Traefik through Docker.

Expected results
When I send a browser request to http://subdomain.mywebsite.com/dashboard/ I would expect to be:

  • redirected to https and presented with the correct Let's Encrypt certificate (working)
  • prompted for my basic auth credentials (not working)
  • shown the dashboard when the credentials are correct (not working)

My docker-compose.yml:

version: '3'

services:
  traefik:
    container_name: traefik
    image: traefik:v2.4
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /host_path_to/traefik.yml:/etc/traefik/traefik.yml:ro
      - /host_path_to/acme/:/acme/
      - /host_path_to/log/:/log/
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      - "traefik.http.routers.dashboard.rule=Host(`subdomain.mywebsite.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=traefikauth@docker"
      - "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
	  - "traefik.http.middlewares.traefikauth.basicauth.users=someuser:$$nevr$$G0nna$$Giv3Uup."

My configuration YAML:

global:
  checkNewVersion: true
  sendAnonymousUsage: false

entryPoints:
  web:
    address: :80
  websecure:
    address: :443

log:
  level: DEBUG
  filePath: /log/traefik.log

accessLog:
  filePath: /log/access-log.txt

api:
  insecure: false
  dashboard: true

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

certificatesResolvers:
  letsencrypt:
    acme:
      email: "my@email.com"
      storage: /acme/acme.json
      keyType: "RSA4096"
      tlsChallenge: true

Contents of traefic.log:

level=info msg="Traefik version 2.4.2 built on 2021-02-02T17:20:41Z"
level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"web\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{},\"http\":{}},\"websecure\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{},\"http\":{}}},\"providers\":{\"providersThrottleDuration\":2000000000,\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmModeRefreshSeconds\":15000000000}},\"api\":{\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"filePath\":\"/log/traefik.log\",\"format\":\"common\"},\"accessLog\":{\"filePath\":\"/log/access-log.txt\",\"format\":\"common\",\"filters\":{},\"fields\":{\"defaultMode\":\"keep\",\"headers\":{\"defaultMode\":\"drop\"}}},\"certificatesResolvers\":{\"letsencrypt\":{\"acme\":{\"email\":\"my@email.com\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/acme/acme.json\",\"keyType\":\"RSA4096\",\"tlsChallenge\":{}}}}}"
level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://doc.traefik.io/traefik/contributing/data-collection/\n"
level=info msg="Starting provider aggregator.ProviderAggregator {}"
level=debug msg="Start TCP Server" entryPointName=web
level=debug msg="Start TCP Server" entryPointName=websecure
level=info msg="Starting provider *traefik.Provider {}"
level=info msg="Starting provider *acme.Provider {\"email\":\"my@email.com\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/acme/acme.json\",\"keyType\":\"RSA4096\",\"tlsChallenge\":{},\"ResolverName\":\"letsencrypt\",\"store\":{},\"TLSChallengeProvider\":{\"Timeout\":2000000000},\"HTTPChallengeProvider\":{}}"
level=info msg="Testing certificate renew..." providerName=letsencrypt.acme
level=debug msg="Configuration received from provider internal: {\"http\":{\"services\":{\"api\":{},\"dashboard\":{},\"noop\":{}},\"serversTransports\":{\"default\":{\"maxIdleConnsPerHost\":200}}},\"tcp\":{},\"tls\":{}}" providerName=internal
level=debug msg="Configuration received from provider letsencrypt.acme: {\"http\":{},\"tls\":{}}" providerName=letsencrypt.acme
level=info msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmModeRefreshSeconds\":15000000000}"
level=info msg="Starting provider *acme.ChallengeTLSALPN {\"Timeout\":2000000000}"
level=debug msg="No default certificate, generating one"
level=debug msg="Provider connection established with docker 20.10.3 (API 1.41)" providerName=docker
level=debug msg="Filtering disabled container" providerName=docker container=traefik-containers-01f92878cf5ce6d8da33e4dff8d7919cb2a5bb9744d01db6bcb8c219036e431c
level=debug msg="Configuration received from provider docker: {\"http\":{},\"tcp\":{},\"udp\":{}}" providerName=docker
level=debug msg="No default certificate, generating one"
level=debug msg="Adding certificate for domain(s) subdomain.mywebsite.com"
level=debug msg="No default certificate, generating one"
level=debug msg="No default certificate, generating one"
level=debug msg="Adding certificate for domain(s) subdomain.mywebsite.com"
level=debug msg="No default certificate, generating one"
level=debug msg="No default certificate, generating one"

Help would be very much appreciated! :heart:

Nevermind, fixed it. I swear I tried these settings before but now it works. Might have been a typo.

What I have changed to fix it

The docker-compose.yml file now contains:

version: '3'

services:
  traefik:
    container_name: traefik
    image: traefik:v2.4
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /host_path_to/traefik.yml:/etc/traefik/traefik.yml:ro
      - /host_path_to/acme/:/acme/
      - /host_path_to/log/:/log/
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.entrypoints=web"
      - "traefik.http.routers.traefik.rule=Host(`subdomain.mywebsite.com`)"
      - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
      - "traefik.http.routers.traefik-secure.entrypoints=websecure"
      - "traefik.http.routers.traefik-secure.rule=Host(`subdomain.mywebsite.com`)"
      - "traefik.http.routers.traefik-secure.tls=true"
      - "traefik.http.routers.traefik-secure.tls.certresolver=letsencrypt"
      - "traefik.http.routers.traefik-secure.service=api@internal"
      - "traefik.http.middlewares.traefik-auth.basicauth.users=someuser:$$nevr$$G0nna$$Giv3Uup."
      - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"

The examples in the documentation are somewhat basic. For this to work properly it needs some more configuration than I initially thought.
The original source for this fix can be found on this Github repo: reactioncommerce/proxy-traefik.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.