# Dashbord Secure Mode - 404 page not found

**URL:** <https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526>\
**Category:** Traefik v2\
**Tags:** dashboard-api, letsencrypt-acme, docker\
**Created:** [May 3, 2021, 8:20am UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526 "2021-05-03T08:20:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafaelrdealmeida](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/rafaelrdealmeida/32/3730_2.png) [@rafaelrdealmeida](https://community.traefik.io/u/rafaelrdealmeida)\
**Post date:** [May 3, 2021, 8:20am UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/1 "2021-05-03T08:20:52Z")

</div>

Hi, I'm trying unsuccessfully to configure the traefik dashboard in secure mode. I tried to follow the doc and a tutorial on the traefik blog, but I still couldn't solve it.

the page appears with ssl certificate active, but has the message: "404 page not found"

Any tips?

```auto

reverse-proxy:
    image: traefik:v2.4
    restart: always
    command: 
      - "--api.dashboard=true"  
      - "--providers.docker=true"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.websecure.http.tls=true"
      - "--certificatesresolvers.ssl.acme.email=email@mail"
      - "--certificatesresolvers.ssl.acme.storage=/letsencrypt/acme.json"
      - "--certificatesresolvers.ssl.acme.httpchallenge=true"
      - "--certificatesresolvers.ssl.acme.httpchallenge.entrypoint=web"
      - "--providers.docker.exposedByDefault=false"
    labels:
      - "traefik.enable=true"
      # global redirect to https 
      - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.redirs.entrypoints=web"
      - "traefik.http.routers.redirs.middlewares=redirect-to-https"
      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
      ## api-secure
      - "traefik.http.routers.dashboard.rule=Host(`sub.dominio.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=auth"
      - "traefik.http.routers.dashboard.tls.certresolver=ssl"
      - "traefik.http.routers.dashboard.entrypoints=websecure"
      - "traefik.http.middlewares.auth.basicauth.users=test:xxx"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro" 
      - "./letsencrypt:/letsencrypt"

```

- [https://traefik.io/blog/traefik-2-0-docker-101-fc2893944b9d/](https://traefik.io/blog/traefik-2-0-docker-101-fc2893944b9d/)
- [Dashboard - Traefik](https://doc.traefik.io/traefik/operations/dashboard/)

best

---

<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 4, 2021, 12:18pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/2 "2021-05-04T12:18:08Z")

</div>

Hi @rafaelrdealmeida

Are you just missing the training `/` after `https://sub.dominio.com/dashboard/` ?

---

<div class="post-metadata">

**Author:** ![jasontheiler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jasontheiler/32/3738_2.png) [@jasontheiler](https://community.traefik.io/u/jasontheiler)\
**Post date:** [May 4, 2021, 4:08pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/3 "2021-05-04T16:08:02Z")

</div>

Hey there!

I'm facing the same problem and from what I have found on the forum so far, I'd say that it's because the labels in the `docker-compose.yml` are not part of the _dynamic configuration_, but of the _static configuration_.

The dashboard router configuration needs to be part of the _dynamic configuration_, though. So you'd probably have to configure it via a `traefik.toml` or `traefik.yml` by activating the file provider and adding the correct volume.

**This needs confirmation, though!**

It'd be really convenient if one could configure the dashboard router via the labels in the `docker-compose.yml`.

---

<div class="post-metadata">

**Author:** ![tommoulard](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tommoulard/32/2997_2.png) [@tommoulard](https://community.traefik.io/u/tommoulard)\
**Post date:** [May 4, 2021, 4:26pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/4 "2021-05-04T16:26:58Z")

</div>

Actually, service labels in docker-compose **are** a way to provide a dynamic configuration to traefik.  
The static configuration can be expressed using arguments to traefik or by using a `traefik.toml` of `traefik.yml` file.

Routers configuration are part of the dynamic configuration, thus you need to provide (via the use of a provider) some kind of dynamic configuration to traefik.

For example, you'll find in my [own traefik configuration](https://github.com/tomMoulard/make-my-server/blob/master/traefik/docker-compose.traefik.yml) that uses `command` to provide a [static configuration](https://github.com/tomMoulard/make-my-server/blob/master/traefik/docker-compose.traefik.yml#L7-L37), and a set of [labels](https://github.com/tomMoulard/make-my-server/blob/master/traefik/docker-compose.traefik.yml#L50-L55) and a [file provider](https://github.com/tomMoulard/make-my-server/blob/master/traefik/docker-compose.traefik.yml#L36) with a [folder](https://github.com/tomMoulard/make-my-server/tree/master/traefik/dynamic_conf) to provide the dynamic configuration needed to build middlewares and the traefik dashboard with `Secure mode`.

Hope it helps 🙂

---

<div class="post-metadata">

**Author:** ![rafaelrdealmeida](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/rafaelrdealmeida/32/3730_2.png) [@rafaelrdealmeida](https://community.traefik.io/u/rafaelrdealmeida)\
**Post date:** [May 4, 2021, 6:08pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/5 "2021-05-04T18:08:02Z")

</div>

That's it, thanks!

Despite the fact that the trailing slash is mandatory in the examples given in the documentation, they have not been included. This can cause confusion and increase questions on the forum.

I made a pull request about adjusting this in the documentation

> <https://github.com/traefik/traefik/pull/8113>
>
> Although it is very explicit in the documentation the mandatory trailing slash i…n the examples indicated they have not been placed. This can cause confusion and increase questions on the forum (I asked about it;)
> 
> \<!--
> PLEASE READ THIS MESSAGE.
> 
> Documentation fixes or enhancements:
> \- for Traefik v1: use branch v1.7
> \- for Traefik v2: use branch v2.4
> 
> Bug fixes:
> \- for Traefik v1: use branch v1.7
> \- for Traefik v2: use branch v2.4
> 
> Enhancements:
> \- for Traefik v1: we only accept bug fixes
> \- for Traefik v2: use branch master
> 
> HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
> 
> \--\>
> 
> \### What does this PR do?
> 
> 
> 
> \### Motivation
> 
> 
> 
> \### More
> 
> \- \[\] Added/updated tests
> \- \[\] Added/updated documentation
> 
> \### Additional Notes

---

<div class="post-metadata">

**Author:** ![rafaelrdealmeida](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/rafaelrdealmeida/32/3730_2.png) [@rafaelrdealmeida](https://community.traefik.io/u/rafaelrdealmeida)\
**Post date:** [May 4, 2021, 6:20pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/6 "2021-05-04T18:20:35Z")

</div>

/dashboard/ works here, but /api/ still no. Is any adjustment still needed and I missed it?  
config docker-compose:

```auto
reverse-proxy:
    image: traefik:v2.4
    restart: always
    command: 
      - "--api.dashboard=true"  
      - "--providers.docker=true"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.websecure.http.tls=true"
      - "--certificatesresolvers.ssl.acme.email=email@mail"
      - "--certificatesresolvers.ssl.acme.storage=/letsencrypt/acme.json"
      - "--certificatesresolvers.ssl.acme.httpchallenge=true"
      - "--certificatesresolvers.ssl.acme.httpchallenge.entrypoint=web"
      - "--providers.docker.exposedByDefault=false"
    labels:
      - "traefik.enable=true"
      # global redirect to https 
      - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.redirs.entrypoints=web"
      - "traefik.http.routers.redirs.middlewares=redirect-to-https"
      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
      ## api-secure
      - "traefik.http.routers.dashboard.rule=Host(`sub.dominio.com`) && (PathPrefix(`/api/`) || PathPrefix(`/dashboard/`))"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=auth"
      - "traefik.http.routers.dashboard.tls.certresolver=ssl"
      - "traefik.http.routers.dashboard.entrypoints=websecure"
      - "traefik.http.middlewares.auth.basicauth.users=test:xxx"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro" 
      - "./letsencrypt:/letsencrypt"

```

---

<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 4, 2021, 7:47pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/7 "2021-05-04T19:47:17Z")

</div>

Is the dashboard loading? Or are you trying to hit the /api/ endpoint directly ?

I'm using your config(letsencrypt disabled) fine.

The endpoints for api are documented here:  
[https://doc.traefik.io/traefik/operations/api/#endpoints](https://doc.traefik.io/traefik/operations/api/#endpoints)

---

<div class="post-metadata">

**Author:** ![rafaelrdealmeida](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/rafaelrdealmeida/32/3730_2.png) [@rafaelrdealmeida](https://community.traefik.io/u/rafaelrdealmeida)\
**Post date:** [May 4, 2021, 9:15pm UTC](https://community.traefik.io/t/dashbord-secure-mode-404-page-not-found/10526/8 "2021-05-04T21:15:32Z")

</div>

I got confused here, sorry. I thought that the api and dashboard pointed to the same place and from there I saw the endpoints, but the api in this case is itself "# /http/services", for example, correct?
