Hi,
I am trying to proxy the Traefik admin panel URL to use a custom prefix (/traefik
). My testing domain is lenovo.lab
.
I modified my dynamic configuration .yml file accordingly to the official Traefik documentation, however, so far I haven't been able to get it to work.
While requesting http://lenovo.lab/traefik
I am getting HTTP 404 error.
However, request for http://lenovo.lab/dashboard
returns HTTP 401 UNAUTHORIZED error.
I generated my credentials as stated in documentation.
I am also proxying another service - Apache Guacamole which works just fine (though I haven't tested it with authentication yet).
My docker-compose file:
version: '3'
services:
traefik:
container_name: cvmm-traefik-proxy
restart: always
image: traefik
command:
#DELETE BEFORE RELEASING
- "--providers.docker=true"
- "--log.level=DEBUG"
#- "--api.insecure=true"
- "--api.dashboard=true"
- "--providers.file.directory=/dynamic-configuration"
- "--providers.file.watch=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./dynamic-configuration:/dynamic-configuration"
networks:
cvmm-external:
cvmm-internal:
networks:
cvmm-external:
name: cvmm-external
external: false
cvmm-internal:
name: cvmm-internal
external: true
My dynamic configuration file:
http:
routers:
cvmm-traefik-router:
rule: Host(`lenovo.lab`) && (PathPrefix(`/traefik`) || PathPrefix(`/dashboard`) || PathPrefix(`/api`))
service: api@internal
entryPoints: web
middlewares: auth
cvmm-guacamole-guacamole-router:
rule: "Host(`lenovo.lab`) && PathPrefix(`/guacamole`)"
service: cvmm-guacamole-guacamole-service
entryPoints: web
middlewares:
auth:
basicAuth:
users:
- "test:$apr1$ssuQ3rCw$ls3xyHMqzgDXdhBXucGEp/"
services:
cvmm-guacamole-guacamole-service:
loadBalancer:
servers:
- url: "http://cvmm-guacamole-guacamole:8080/guacamole"