Hi everyone,
I've got a Traefix set up and I'm trying to expose a dashboard to the interwebs. I've combed through the docs and I can't for the life of me figure out how to expose the docs to a subdomain of one of my sites. I've got the following docker-compose file:
services:
traefik:
container_name: traefik
image: "traefik"
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`foo.bar.dev`) && PathPrefix(`/`)"
- "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.service=dashboard@internal"
- "traefik.http.routers.dashboard.middlewares=dashboard_redirect@internal,dashboard_stripprefix@internal"
- "traefik.http.routers.dashboard.priority=2"
- "traefik.http.routers.api.rule=Host(`foo.bar.dev`) && PathPrefix(`/api`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.priority=1"
- "traefik.http.routers.api.middlewares=dashboard_redirect@internal,dashboard_stripprefix@internal"
ports:
- "443:443"
- "8080:8080"
expose:
- 443
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik.toml:/traefik.toml"
version: "3.3"
and the following traefik.toml file:
[accessLog]
[api]
dashboard = true
insecure = true
[providers.docker]
exposedByDefault = false
[entryPoints]
[entryPoints.websecure]
address = ":443"
I still get a 404 on the subdomain. The certificates are arranged by cloudflare so I land on port 443 in my network without any problems. My port is then forwarded by my routers to my Traefix server. I feel like the host rule is not being triggered because when I access port 8080 directly from the IP in the internal network I can access the dashboard and see the two rules set in docker.
Anybody who can point me in the right direction?