Hi everyone,
I try to put the API and the dashboard one subfolder down under /traefik
, which works in general, but the StripPrefix and the dashboard do not work together. All returned links are not prefixed with my prefix, as they should be according to the documentation of StripPrefix. My docker-compose.yml
file is this:
version: '2'
services:
traefik:
image: traefik:2.0
command: --api.insecure=true --providers.docker --log.level=DEBUG --entryPoints.http.address=:80 --entryPoints.https.address=:443
restart: unless-stopped
ports:
- 80:80
- 8080:8080
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
# printf "traefik:$( openssl passwd -apr1 traefik 2>&1 | sed -e 's/\$/\$\$/g')"
- traefik.http.middlewares.auth.basicauth.users=traefik:$$apr1$$SgL.xvfB$$pAb2/ufjHlC8dyLK9ssdW1
- traefik.http.routers.api.middlewares=chain
- traefik.http.routers.api.rule=PathPrefix(`/traefik`)
- traefik.http.routers.api.service=api@internal
# TLS stuff including redirection
- traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
- traefik.http.routers.api.tls=true
- traefik.http.routers.api.entryPoints=https
- traefik.http.routers.api_http.middlewares=https_redirect
- traefik.http.routers.api_http.entryPoints=http
- traefik.http.routers.api_http.rule=PathPrefix(`/traefik`)
# Middleware Chain
- traefik.http.middlewares.chain.chain.middlewares=auth,path-strip
- traefik.http.middlewares.path-strip.stripprefix.prefixes=/traefik
I also activated the insecure API in order to "look at things", but everything looks ok to me.
Best,
Andreas