Hello,
I have a problem to configure the secure dashboard with Docker Swarm and without the "Host" clause. I still get a 404 error. The "whoami01" service work well.
version: '3.8'
services:
traefik:
image: traefik:v2.9
command:
# Use Docker Swarm
- --providers.docker=true
- --providers.docker.swarmmode=true
- --providers.docker.exposedbydefault=false
# Add the entrypoints
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
# Redirect 80 -> 443
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.web.http.redirections.entrypoint.permanent=true
# Add configuration files
- --providers.file.directory=/configuration/
- --providers.file.watch=true
# Enable dashboard
- --api.dashboard=true
# Enable logs
- --log.level=DEBUG
- --log.filePath=/tmp/traefik.log
# Enable access logs
- --accesslog=true
- --accesslog.filepath=/tmp/access.log
- --accesslog.bufferingsize=100
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-configuration:/configuration/
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.dashboard.rule=PathPrefix(`/api`, `/dashboard`) # https://localhost/dashboard/
- traefik.http.routers.dashboard.entrypoints=websecure
- traefik.http.routers.dashboard.tls=true
- traefik.http.routers.dashboard.service=api@internal
- traefik.http.services.dummy-svc.loadbalancer.server.port=9999
whoami01:
image: traefik/whoami:latest
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.whoami01.rule=Path(`/whoami01`) # https://localhost/whoami01/
- traefik.http.routers.whoami01.entrypoints=websecure
- traefik.http.routers.whoami01.tls=true
- traefik.http.services.whoami01.loadbalancer.server.port=80
volumes:
traefik-configuration:
Can you help me please?
Thank you.