Another dashboard 404 error

Hi guys,
I am new to traefik and got stuck with the secure setup of the traefik dashboard (docker enviroment).
As soon as I try to secure the dashboard with basic auth and deliever it over https, I get error 404 in my browser. The insecure setup via port 8080 works without errors.
I have read many posts here on the forum, stackoverflow, etc and tried many different configurations but could not solve the problem.
My actual config i found on hxxts://dev.to in an post from Tashin. Maybe some of you could give me a hint. I think it a router problem but im̀ not sure.

The URL i try to access is: hxxps://traefik.xyz.xy/dashboard/

traefik.yml
entryPoints:
  web:
    address: :80

  websecure:
    address: :443

api:
  insecure: false
  dashboard: true
docker-compose.yml
version: '3.7'

services:
  traefik:
    image: traefik:v2.8
    container_name: traefik
    restart: unless-stopped
    environment:
      - TZ=Europe/Berlin
    command:
      --providers.docker
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik_https.rule=Host(`traefik.xyz.xy`)"
      - "traefik.http.routers.traefik_https.entrypoints=websecure"
      - "traefik.http.routers.traefik_https.tls=true"
      - "traefik.http.routers.traefik_https.tls.certResolver=myresolver"
      - "traefik.http.routers.traefik_https.service=api@internal"
      - "traefik.http.routers.traefik_https.middlewares=basic-auth-global"
      - "traefik.http.middlewares.basic-auth-global.basicauth.users=xyz:xyz"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik:/etc/traefik

Thank you!
Regards Cxenan

Hi @cxenan , it seems you're missing some static configuration to create the entrypoints in Traefik.
It works with insecure because that enables an internal entrypoint automatically at port 8080. Here is a complete stack to take as example:

version: "3.7"

networks:
  traefik:

services:
  traefik:
    image: "traefik/traefik:latest"
    labels:
      #Dashboard
      - "traefik.enable=true"
      - "traefik.http.routers.api.entrypoints=web"
      - "traefik.http.routers.api.rule=Host(`traefik.docker.localhost`)"
      - "traefik.http.routers.api.service=api@internal"
    command:
      - --providers.docker
      - --entryPoints.web.address=:80
      - --entryPoints.websecure.address=:443
      - --api.dashboard=true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "80:80"
      - "443:443"
    networks:
      - traefik

I hope this helps you get started

It's probably just an issue with placing the config in static and dynamic config. With this config you can use the dashboard with user/pass as soon as you access the host on the extra port 8080, ignoring any hostname.

traefik.yml:

entryPoints:
  web:
    address: :80
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: :443
  traefik:
    address: :8080

api:
  debug: true
  dashboard: true
  insecure: false

dynamic.yml:

http:
  routers:
    dashboard:
      entryPoints:
        - traefik
      rule: PathPrefix(`/api`) || PathPrefix(`/dashboard`) || PathPrefix(`/debug`)
      service: api@internal
      middlewares:
        - auth
  middlewares:
    auth:
      basicAuth:
        users:
          - "admin:hashedpassword"