Secure Dashboard Code is not working

Sample code on documentation is not working

Traefik Config;

entryPoints:
  web-secure:
    address: ':443'

api: {}

providers:
  file:
    filename: /dynamic-conf.yaml

Dynamic Config;

http:
  routers:
    api:
      rule: Host(`mydomain.local`)
      entrypoints:
        - web-secure
      service: api@internal
      middlewares:
        - myAuth
      tls: {}

  middlewares:
    myAuth:
      basicAuth:
        users:
          - 'test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/'

I get 404 when I visit https://myDomain.local/dashboard

Note mydomain.local is pointed to 127.0.0.1 in etc/hosts

Hello,

It works, maybe you have a misplaced the dynamic file: / is not ./

$ curl -k -u test:test https://mydomain.local
<a href="/dashboard/">Found</a>.
$ curl -k -u test:test https://mydomain.local/dashboard/
<!DOCTYPE html><html><head>
...

Note the URL to call the dashboard https://mydomain.local/dashboard/ (with a trailing slash)

https://docs.traefik.io/v2.0/operations/dashboard/

Watch your logs to get more information.

Thanks for the answer @ldez

You are saying something wrong with the dynamic config path? I copy everything to root.

#      - $PWD/traefik.yml:/traefik.yml
#      - $PWD/dynamic_conf.yml:/dynamic_conf.yml
#      - $PWD/acme.json:/acme.json
#      - $PWD/cert/master.local.pem:/cert/master.local.pem
#      - $PWD/cert/master.local-key.pem:/cert/master.local-key.pem 

dynamic-conf.yaml != dynamic_conf.yml check the name.

Watch your logs to get more information.

Recommend read: