HTTP 404 when trying to reach Dashboard

Hello,
I have some issues setting up Traefik v2.

Here is my traefik.toml:

[global]
  checkNewVersion = true
  sendAnonymousUsage = false

[entryPoints]
  [entryPoints.http]
    address = ":80"

  [entryPoints.https]
    address = ":443"

[certificatesResolvers.myresolver.acme]
  email = "cert@mydomain.com"
  storage = "acme.json"
  [certificatesResolvers.myresolver.acme.httpChallenge]
    # used during the challenge
    entryPoint = "http"

[http.routers]
  [http.routers.router1]
    tls = true
    service = "api@internal"
    middlewares = ["basic-auth-middleware"]
    rule = "Host(`monitor.mydomain.com`)"

[http.middlewares]
  [http.middlewares.basic-auth-middleware.basicAuth]
    users = ["admin:$.../"]

[log]
  level = "DEBUG"

[api]
  dashboard = true

And this is my docker-compose.yml:

version: '3'

services:
  traefik:
    container_name: traefik
    image: traefik:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.toml:/traefik.toml:ro
      - ./acme.json:/acme.json
    ports:
      - 80:80
      - 443:443
    networks:
      - web
    labels:
      - "traefik.enable=true"

networks:
  web:
    external: true

When I build, run the container und execute curl monitor.mydomain.com, I get:
404 page not found

Thank you very much in advance.

You have defined your router in the static configuration file. You need to define it in a dynamic configuration.

1 Like

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