avaj
1
I am pretty new playing around traefik. I want to enable auth based traefik dashboard but I am no where close to it.
traefik.toml
[api]
dashboard = true
[entryPoints]
[entryPoints.dashboard]
address = ":8443"
[http.routers.api]
rule = "PathPrefix(`/dashboard`))"
entryPoints = ["dashboard"]
service = "api@internal"
middlewares = ["auth"]
[http.middlewares.auth.basicauth]
users = [
"user:passwd",
]
I tried things around entrypoints and routers but couldn't get it working, page simply returns 404.
cakiwi
2
You are mixing you dynamic and static configuration in the same file. You will need to split them up.
https://doc.traefik.io/traefik/getting-started/configuration-overview/
avaj
3
I moved out my router config to dynamic configuration file but I still get 404
traefik.toml
[api]
dashboard = true
[entryPoints]
[entryPoints.dashboard]
address = ":8443"
[providers.file]
filename = "/etc/traefik-dy.toml"
traefik-dy.toml
[http]
[http.routers.api]
rule = "(PathPrefix(`/dashboard`))"
entryPoints = ["dashboard"]
service = "api@internal"
middlewares = ["auth"]
[http.middlewares]
[http.middlewares.auth.basicauth]
users = [
"user:passwd",
]
cakiwi
4
What url are you using? The dashboard url has to end in / to load correclty.
i.e. http://example.com/dashboard/
avaj
5
yes I am ending the URL correctly with /
http://domain:8443/dashboard/
cakiwi
6
You're missing rules for the /api endpoint too, they are both required for the dashboard.
https://doc.traefik.io/traefik/operations/dashboard/#dashboard-router-rule