# No way to get dashboard to work in secure mode

**URL:** <https://community.traefik.io/t/no-way-to-get-dashboard-to-work-in-secure-mode/8156>\
**Category:** Traefik v2\
**Tags:** dashboard-api\
**Created:** [October 12, 2020, 1:42pm UTC](https://community.traefik.io/t/no-way-to-get-dashboard-to-work-in-secure-mode/8156 "2020-10-12T13:42:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamka02sk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lamka02sk/32/1767_2.png) [@lamka02sk](https://community.traefik.io/u/lamka02sk)\
**Post date:** [October 12, 2020, 1:42pm UTC](https://community.traefik.io/t/no-way-to-get-dashboard-to-work-in-secure-mode/8156/1 "2020-10-12T13:42:53Z")

</div>

Hello,  
I am trying to understand how to make dashboard in secure mode with Docker Swarm work locally, but I can't get it to work. The documentation is not helpful at all in this case, as it sucks. This is my configuration:  
**Static config:**

```auto
[log]
level = "INFO"

[accessLog]

[api]
dashboard = true

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

    [entryPoints.websecure]
    address = ":443"

[providers.docker]
endpoint = "unix:///var/run/docker.sock"
exposedByDefault = false
swarmMode = true
swarmModeRefreshSeconds = 15
watch = true

[http.middlewares]
    [http.middlewares.basic-auth.basicAuth]
    usersFile = "/etc/httpd/.htpasswd"

```

and then in **docker stack file:**

```auto
proxy:
    image: traefik:v2.3
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.dashboard.rule=Host(`traefik.domain.tld`)" # This domain is defined locally in /etc/hosts
        - "traefik.http.routers.dashboard.middlewares=basic-auth"
        - "traefik.http.routers.dashboard.service=api@internal"
        - "traefik.http.routers.dashboard.entrypoints=web"
      placement:
        constraints:
          - "node.labels.role==master"
      restart_policy:
        condition: on-failure
        delay: 1s
        window: 10s
    networks:
      - public
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
      - target: 443
        published: 443
        protocol: tcp
        mode: host
      - 8080:8080
    volumes:
      - ./config/traefik/traefik.toml:/etc/traefik/traefik.toml:ro
      - /etc/httpd/.htpasswd:/etc/httpd/.htpasswd:ro
      - /var/run/docker.sock:/var/run/docker.sock

```

I have no idea what is wrong here and I waster hours to get it to work with no result. Do I need to have SSL enabled for it to work? Is there a mistake in my configuration? I have no idea.  
All I get is 404.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [October 12, 2020, 2:33pm UTC](https://community.traefik.io/t/no-way-to-get-dashboard-to-work-in-secure-mode/8156/2 "2020-10-12T14:33:30Z")

</div>

Hello,

The `http.middlewares` configuration is a part of the [dynamic configuration](https://docs.traefik.io/v2.3/getting-started/configuration-overview/#the-dynamic-configuration).

The file `traefik.toml` contains the [static configuration](https://docs.traefik.io/v2.3/getting-started/configuration-overview/#the-static-configuration).

So you have to create a dedicated file to put the [dynamic configuration](https://docs.traefik.io/v2.3/getting-started/configuration-overview/#the-dynamic-configuration) and use the [file provider](https://doc.traefik.io/traefik/v2.3/providers/file/#directory).

---

<div class="post-metadata">

**Author:** ![lamka02sk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lamka02sk/32/1767_2.png) [@lamka02sk](https://community.traefik.io/u/lamka02sk)\
**Post date:** [October 12, 2020, 3:29pm UTC](https://community.traefik.io/t/no-way-to-get-dashboard-to-work-in-secure-mode/8156/3 "2020-10-12T15:29:23Z")

</div>

Thank you, it works! Documentation can be very confusing sometimes and me trying to things the most efficient way (at least according to me) didn't help 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [October 15, 2020, 3:29pm UTC](https://community.traefik.io/t/no-way-to-get-dashboard-to-work-in-secure-mode/8156/4 "2020-10-15T15:29:27Z")

</div>

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