Not able to access dashboard - Secure Mode

Hi!
I am new to Traefik and I already fail at the very first steps. I am trying to get the dashboard working with the secure configuration but I am unsuccessful. The insecure version is working.
Here are my docker-compose.yaml und the traefik.toml:

version: "3.3"
services:
  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    ports:
      - "8080:8080"
      - "80:80"
    networks:
      - "proxy"
    command:
      - "--providers.docker=true"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "/home/test/traefik/traefik.toml:/traefik.toml"
      - "/home/test/traefik/logs:/logs"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.api.rule=Host(`router.domain.com`)"
      - "traefik.http.routers.api.service=api@internal"
      - "traefik.http.routers.api.middlewares=api-auth"
      - "traefik.http.middlewares.api-auth.basicauth.users=admin:$$apr1$$k.xT.Eq0$$cvQcAlA2g8couVSCZotNp/"
    restart: always

networks:
  proxy:
    external: true
[global]
  checkNewVersion = true

[log]
  filePath = "/logs/traefik.log"
  level = "INFO"

[accessLog]
  filePath = "/logs/access.log"
  bufferingSize = 100

[api]
  dashboard = true

If I try to connect to "router.domain.com" nothing happens.

Hello,

There are three different, mutually exclusive (e.g. you can use only one at the same time), ways to define static configuration options in Traefik:

So either you use a file or you use CLI flags but not both.

version: '3.3'
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - 8080:8080
      - 80:80
    networks:
      - proxy
    command:
      - --global.checkNewVersion=true
      - --providers.docker=true
      - --api
      - --log.filePath=/logs/traefik.log
      - --log.level=INFO
      - --accessLog.filePath=/logs/access.log
      - --accessLog.bufferingSize=100
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/test/traefik/logs:/logs
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.api.rule=Host(`router.domain.com`)"
      - "traefik.http.routers.api.service=api@internal"
      - "traefik.http.routers.api.middlewares=api-auth"
      - "traefik.http.middlewares.api-auth.basicauth.users=admin:$$apr1$$k.xT.Eq0$$cvQcAlA2g8couVSCZotNp/"
    restart: always

networks:
  proxy:
    external: true
1 Like

@ldez: Thank you so much, that did the trick!
Actually, as a new user to Traefik, I am a little bit confused about all the different configuration options. Not only that many howtos on the internet still refer to v1 config examples but also in v2 it is very difficult for me to understand which config/file/provider does what and what are the constraints.
But I guess I just need the read the documentation more carefully :wink:

1 Like