The "stripprefix example" you shared, worked as expect over http://mydomain.club/traefik. Nice. Then I thought it was an issue with my TLS setup. After many try and error and thought « let's disable the basic auth ».
As we have a http-catchall router, we actually have two entrypoints ==> web + websecure
On my side, my two webapps and the dashboard works regardless I use the label traefik.http.routers.traefik.entrypoints=websecure or not. So, I feel that the traefik.http.routers.http-catchall.entrypoints=web does it's job in any case.
works good
labels:
#### set core configs
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`mydomain.club`) && (PathPrefix(`/traefik`) || PathPrefix(`/api`))"
#### set traefik dashboard
- "traefik.http.routers.traefik.service=api@internal"
#### set middlewares: stripprefix for dashboard
- "traefik.http.routers.traefik.middlewares=mystrip"
- "traefik.http.middlewares.mystrip.stripprefix.prefixes=/traefik"
#### set TLS
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls.certresolver=leresolver"
#### set a rule to redirect all http requests to https
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
no bueno
But my glitch persist, when I use basic auth, the dashboard is not available.
labels:
#### set core configs
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`mydomain.club`) && (PathPrefix(`/traefik`) || PathPrefix(`/api`))"
#### set traefik dashboard
- "traefik.http.routers.traefik.service=api@internal"
#### set middlewares: stripprefix for dashboard + BasicAuth
- "traefik.http.routers.traefik.middlewares=mystrip,myauth"
- "traefik.http.middlewares.mystrip.stripprefix.prefixes=/traefik"
- "traefik.http.middlewares.myauth.basicauth.users=pascalandy:$$2y$$05$$W10189ezy/7skshywvcz9.nc8yR6M8GvFZmnKugkzsoIGQycJS8Y6"
#### set TLS
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.tls.certresolver=leresolver"
#### set a rule to redirect all http requests to https
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
I don't think it's related to the issue I have but I redefine the "basicauth middleware" for each services (green + home). Would it be better to define only one and reuse it on all service?