Dashboard returns 404

Whenever I try accessing the dashboard either via HTTP or HTTPS (either via Google Chrome or curl) I'm met with a 404 page. I've searched through multiple other community threads/GitHub issues with no result whatsoever (Please bear in mind I'm quite new to Traefik). The docker-compose section (focusing on traefik service for brevity purposes) is the following:

version: "3.8"
services:
  proxy:
    container_name: proxy
    image: traefik:v2.10
    ports:
      - "80:80"
      - "443:443"
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /var/log:/var/log
      - network-certificates:/certificates
    environment:
      DUCKDNS_TOKEN: <TOKEN>
    command:
      - --log.level=DEBUG
      # Staging certificate resolver
      - --certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
      # Enable Docker in Traefik, so that it reads labels from Docker services
      - --providers.docker
      # Do not expose all Docker services, only the ones explicitly exposed
      - --providers.docker.exposedByDefault=false
      # Create an entrypoint "http" listening on port 80
      - --entrypoints.http.address=: 80
      # Create an entrypoint "https" listening on port 443
      - --entrypoints.https.address=: 443
      # Create the certificate resolver "le" for Let's Encrypt, uses the environment variable EMAIL
      - --certificatesresolvers.le.acme.email=<EMAIL>
      # Store the Let's Encrypt certificates in the mounted volume
      - --certificatesresolvers.le.acme.storage=/certificates/acme.json
      # Use the DNS Challenge for Let's Encrypt
      - --certificatesresolvers.le.acme.dnschallenge=true
      - --certificatesresolvers.le.acme.dnschallenge.provider=duckdns
      # Enable the access log, with HTTP requests
      - --accesslog=true
      - --accesslog.filepath=/var/log/traefik-access.log
      # Enable the Traefik log, for configurations and errors
      - --log
      # Enable the Dashboard and API
      - --api=true
      - --api.dashboard=true
    networks:
      - default
      - network
    healthcheck:
      test: [
    "CMD",
    "traefik",
    "healthcheck"
]
      interval: 30s
      timeout: 3s
      retries: 30
    labels:
      # Enable Traefik for this service, to make it available in the public network
      - traefik.enable=true
      # Use the network network (declared below)
      - traefik.docker.network=network
      # Dashboard
      - "traefik.http.routers.traefik.rule=Host(`dashboard.<SUBDOMAIN>.duckdns.org`)"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.services.api@internal.loadbalancer.server.port=8080"
      - "traefik.http.routers.traefik.tls.certresolver=le"
      - "traefik.http.routers.traefik.entrypoints=https"

      # global redirect to https
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=http"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"

      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
volumes:
  network-certificates:
networks:
  network:
    external: true

See simple Traefik example.

Did you check the Traefik logs for error?

Hello @bluepuma77,

First of all thanks for taking the time to answer me. Yes, I have already checked the logs but sadly I've found nothing to pinpoint the issue. I have already tried the docker-compose file you pointed out but I gave it another shot, with no result whatsoever. Let me clarify that all other services are reachable from their respective subdomains using https (http-to-https redirection also seems to be working fine). Here's my updated docker-compose file (again only the proxy section for brevity purposes):

version: "3.8"
services:
  proxy:
    container_name: proxy
    image: traefik:v3.0
    ports:
      - "80:80"
      - "443:443"
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /var/log:/var/log
      - network-certificates:/certificates
    environment:
      DUCKDNS_TOKEN: <TOKEN>
    command:
      - --api.dashboard=true
      - --log.level=DEBUG
      - --log.filepath=/var/log/traefik.log
      - --accesslog=true
      - --accesslog.filepath=/var/log/traefik-access.log
      - --providers.docker.network=network
      - --providers.docker.exposedByDefault=false
      - --entrypoints.web.address=:80
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entryPoints.web.http.redirections.entrypoint.scheme=https
      - --entrypoints.websecure.address=:443
      - --entrypoints.websecure.asDefault=true
      - --entrypoints.websecure.http.tls.certresolver=le
      - --certificatesresolvers.le.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
      - --certificatesresolvers.le.acme.email=billsioros97@gmail.com
      - --certificatesresolvers.le.acme.storage=/certificates/acme.json
      - --certificatesresolvers.le.acme.dnschallenge=true
      - --certificatesresolvers.le.acme.dnschallenge.provider=duckdns
      - --certificatesresolvers.le.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53
      - --certificatesresolvers.le.acme.tlschallenge=true
    networks:
      - network
    healthcheck:
      test: ["CMD", "traefik" ,"healthcheck"]
      interval: 30s
      timeout: 3s
      retries: 30
    labels:
      - traefik.enable=true
      - traefik.http.routers.mydashboard.rule=Host(`dashboard.<SUBDOMAIN>.duckdns.org`)
      - traefik.http.routers.mydashboard.service=api@internal
      - traefik.http.routers.mydashboard.middlewares=myauth
      - traefik.http.middlewares.myauth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/

I included the DuckDNS related sections as it didn't seem to work without them!

Is healthcheck working? It looks strange, check with docker ps if container gets healthy.

Thank you very much! It seems the healthcheck was messing up traefik and I assume it was filtering itself as an unhealthy service or something of that sort...

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