Dashboard 404 even on official example

Hello community!
I checked lot of posts with dashboard access, but I cannot make it work even with example from docs.
Currently I use traefik 2.10.1. I want to make dashboard available on secure port(443) with authentication. Now I simplify it to get dashboard on http port.
If I enable insecure, then dashboard works.

Here is my config file:

providers:
  docker:
#    allowEmptyServices: true
    exposedByDefault: false

api:
  dashboard: true

log:
  level: DEBUG


################################################################
# Entrypoint
################################################################
entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"

certificatesResolvers:
  resolver:
    acme:
      email: support@my-domain.com
      storage: /etc/traefik/acme/acme.json
      httpChallenge:
        entryPoint: web
  letls:
    acme:
      email: support@my-domain.com
      storage: /etc/traefik/acme/acme.json
      tlsChallenge: {}

My docker-compose:

version: '3.5'

services:
  traefik:
    hostname: traefik
    image: traefik:v2.10.1
    container_name: traefik
    restart: always
    domainname: my-domain.com
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./traefik.yml:/etc/traefik/traefik.yml:ro
      - /etc/localtime:/etc/localtime:ro
      - ./letsencrypt-acme:/etc/traefik/acme:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    labels:
#Current config. Simplified
      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`my-domain.com`)"
      - "traefik.http.routers.dashboard.service=api@internal"

#Prev config found on Github that I should add port for LB
#      - traefik.enable = true
#      - traefik.http.routers.api.rule="Host(`my-domain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
#      - traefik.http.routers.api.entrypoints=websecure
#      - traefik.http.routers.api.service=api@internal
#      - traefik.http.services.dummy.loadBalancer.server.port=65535

#Initial config with tls
#      - traefik.http.routers.api.tls=true
#      - traefik.http.routers.api.rule="Host(`my-domain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
#      - traefik.http.routers.api.entrypoints=websecure
#      - traefik.http.routers.api.tls.certresolver=resolver # Also I try to use letls
#      - traefik.http.routers.api.service=api@internal

    networks:
      apps_net:

networks:
  apps_net:
    external: true

I checked container labels with docker inspect they are intact. Try to connect with curl -404, browser confirm this.
Please help me to fix this.

You need to assign one of your certificatesResolvers to the entrypoint or the router, see simple Traefik example.

Thanks bluepuma77 you save my night!
To solve http connection I added entrypoint and that solve it.
Correct config

      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`my-domain.com`)"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.entrypoints=web"

For HTTPS EntryPoint and certificateResolver

      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`my-domain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.dashboard.entrypoints=web"
      - "traefik.http.routers.dashboard.middlewares=dashboard-https
      - "traefik.http.middlewares.dashboard-https.redirectscheme.scheme=https"
      - "traefik.http.routers.dashboard-secure.entrypoints=websecure"
      - "traefik.http.routers.dashboard-secure.rule=Host(`my-domain.com`) && PathPrefix(`/api`, `/dashboard`)"
      - "traefik.http.routers.dashboard-secure.tls=true"
      - "traefik.http.routers.dashboard-secure.service=api@internal"
      - "traefik.http.routers.dashboard-secure.tls.certresolver=letls"

1 Like

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