# Unable to activate Secure dashboard on traefik 2.2.1

**URL:** <https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223>\
**Category:** Traefik v2\
**Tags:** dashboard-api, docker-swarm\
**Created:** [May 25, 2020, 10:36pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223 "2020-05-25T22:36:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgvargas29](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rgvargas29](https://community.traefik.io/u/rgvargas29)\
**Post date:** [May 25, 2020, 10:36pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/1 "2020-05-25T22:36:26Z")

</div>

Hi Folks,  
I'm new to this traefik, and i'm trying to make the secure dashboard work but so far no luck  
I've read many solutions over the internet here in this very same forum and still none of those worked for me, so I'm here asking for your wisdom as maybe im the problem here.

The only way it works its on insecure mode.

I have a MX record [traefik.mydomain.com](http://traefik.mydomain.com) that points to my manager ip address.  
Im trying to deploy on swarm  
If there is already some solution and i couldnt find it im sorry beforehand for opening this thread but im crazy about this dashboard.

Here is my compose file

version: '3.3'

services:

```
traefik:
    image: traefik:2.2.1
    command:
        - "--api.insecure=true"
        - "--api.dashboard=true"
        - "--api.debug=true"
        - "--log.level=DEBUG"
        - "--providers.docker=true"
        - "--providers.docker.swarmMode=true"
        - "--providers.docker.exposedbydefault=false"
        - "--providers.docker.network=frontend"
        - "--providers.file.filename=/traefik_conf.yaml"
        - "--entryPoints.web.address=:80"
        - "--entryPoints.websecure.address=:443"
        - "--certificatesResolvers.le.acme.email=rgvargas@rickyflix.xyz"
        - "--certificatesResolvers.le.acme.storage=/letsencrypt/acme.json"
        - "--certificatesResolvers.le.acme.tlsChallenge=true"
        - "--certificatesResolvers.le.acme.httpChallenge=true"
        - "--certificatesResolvers.le.acme.httpChallenge.entryPoint=web"
    ports:
        - 80:80
        - 443:443
        - 8080:8080
    networks:
        - frontend
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - type: bind
          source: /dockers/swarm/traefik/traefik_conf.yaml
          target: /traefik_conf.yaml
        - type: bind
          source: /dockers/swarm/letsencrypt
          target: /letsencrypt
    labels:
        # Dashboard
        - "traefik.enable=true"
        - "traefik.http.routers.api.rule=Host(`traefik.mydomain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
        - "traefik.http.routers.api.entrypoints=web"
        - "traefik.http.routers.traefik-secure.rule=Host(`traefik.mydomain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
        - "traefik.http.routers.traefik-secure.entrypoints=websecure"
        - "traefik.http.routers.traefik-secure.tls=true"
        - "traefik.http.routers.traefik-secure.tls.certresolver=le"
        - "traefik.http.routers.api.service=api@internal"
        - "traefik.http.routers.api.middlewares=auth"
        - "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
        # Docker swarm need a dummy service for port detection
        - "traefik.http.services.dummy-service.loadbalancer.server.port=59999"
    deploy:
      placement:
        constraints: [node.role == manager]
      restart_policy:
        condition: on-failure

```

networks:  
frontend:  
external: true

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [May 27, 2020, 2:28pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/2 "2020-05-27T14:28:06Z")

</div>

> [@rgvargas29](#):
>
> I've read many solutions over the internet here in this very same forum and still none of those worked for me

Can you expand on how this is specifically not working/ what is working?

> [@rgvargas29](#):
>
> ` - "--api.insecure=true"`

You have this which sets up the dashboard on port 8080. Is this just a backup while you get this working on on the other entryPoints?

> [@rgvargas29](#):
>
> ```auto
> - "traefik.http.routers.api.rule=Host(`traefik.mydomain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
> ...
> ...
> - "traefik.http.routers.traefik-secure.rule=Host(`traefik.mydomain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
> 
> ```

You have this setup on both web and websecure entrypoints ?

> [@](#):
>
> ```auto
> - "traefik.http.routers.api.middlewares=auth"
> 
> ```

Auth is only setup on the router using the web entrypoint.

---

<div class="post-metadata">

**Author:** ![rgvargas29](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rgvargas29](https://community.traefik.io/u/rgvargas29)\
**Post date:** [May 27, 2020, 4:41pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/3 "2020-05-27T16:41:44Z")

</div>

Hi there  
as per the solutions i've tried, this is the most complete one, still have seen other forum post in here but didnt bookmarked all  
[Solution 1](https://gist.github.com/pascalandy/fd497c39481bd5f0661196d01442b538)

regarding the api.insecure=true i have it activated beacase is the only way i can get in the dashboard for now; when testing the secure dashboard that line and the port 8080 are commented out.

on the entrypoints, yes i have them both i havent been able to redirect http to https so, in all my services i enable them both and do the redirection on the service itself.

Auth: you mean i have to add the auth middlware to the traefik-secure router as well?

Thanks for your time

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [May 29, 2020, 12:54pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/4 "2020-05-29T12:54:42Z")

</div>

Hi @rgvargas29

I just took another look at this. Your labels section is not nested under the `deploy:` label which is where it need to be for swarm mode.

---

<div class="post-metadata">

**Author:** ![rgvargas29](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rgvargas29](https://community.traefik.io/u/rgvargas29)\
**Post date:** [May 29, 2020, 5:04pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/5 "2020-05-29T17:04:34Z")

</div>

Hi cakiwi  
Thanks for your input indeed the labels were misplaced still im getting 404 error then trying to access [http://traefik.mydomain.com](http://traefik.mydomain.com) [https://traefik.mydomain.com](https://traefik.mydomain.com) [http://traefik.mydomain.com/dashboard/](http://traefik.mydomain.com/dashboard/) [https://traefik.mydomain.com/dashboard/](https://traefik.mydomain.com/dashboard/)

Good thing though is that the certificate for the https was generated by the ACME letsencrypt

attached is my "new" labels

 ![labels](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/b6ce42baf4434d072257cd3155a50a5e34644dee.jpeg)

If you happend to see something else wrong please do let me know

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [May 29, 2020, 5:09pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/6 "2020-05-29T17:09:40Z")

</div>

I _think_ is is because you are referencing middleware `auth` but have only defined `test-auth`

---

<div class="post-metadata">

**Author:** ![rgvargas29](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rgvargas29](https://community.traefik.io/u/rgvargas29)\
**Post date:** [May 29, 2020, 5:58pm UTC](https://community.traefik.io/t/unable-to-activate-secure-dashboard-on-traefik-2-2-1/6223/7 "2020-05-29T17:58:46Z")

</div>

> [@cakiwi](#):
>
> ause you are referencing middleware `auth` but have only defined `t`

Thank you , got it working already  
hope this post help some others out in the wild  
Have a nice one.

Regards
