quick question here. I'm quite new to Traefik and would like to rather expose the Traefik dashboard under example.com/traefik rather than traefik.example.com.
I have tried a few options unsuccessfully so far. Furthermore, the documentation says:
No, no but I must admit I have read the documentation in a random order and landed on this paragraph after I had already tried a few things and worked on my target setup.
That is kind of show stopper for me and I just wanted to be sure I really understood this:
The fact that I then must have specific registered FQDN for the dashboard only is too expensive in term of maintenance: my plan was to use Traefic in a setup with docker-compose that exposes a main service together with a DB, a Prometheus server and so on that I want to be able to deploy in one click for test purposes. And the main service has the same limitation than Traefik and must take control of the root of the path...
Can I know more about the deployment? I'm curious what makes it "too expensive"?
Are you using /api and /dashboard elsewhere? Why not leave those for traefik? It doesn't need to take CONTROL of the root of the path, it just needs to have /api and /dashboard.
I've tried that before posting in the forum, but thought it does not work, because:
mydomain.com/api returns a 404 <= normal
mydomain.com/dashboard also returns a 404 <= normal when querying /dashboard (without the trailing slash) instead of /dashboard/with the trailing slash. No comment...
About Prometheus for instance, yes it works, the server can be configured to expose the gathered metrics in a subpath of the FQDN, for those that might be insterrested, such a config works:
In docker-compose.yml file:
prometheus:
image: prom/prometheus
expose:
- 9090
volumes:
- prometheus_data:/prometheus
- ./conf/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=90d
- --web.external-url=https://${PUBLIC_FQDN}/prometheus
- --web.listen-address=:9090
labels:
# Expose the metrics on the reserved sub path, TLS is provided by the Let's Encrypt cert provider.
- traefik.enable=true
- traefik.http.routers.prometheus.rule=Host(`${PUBLIC_FQDN}`)&&PathPrefix(`/prometheus`)
- traefik.http.routers.prometheus.entrypoints=websecure
- traefik.http.services.prometheus.loadbalancer.server.port=9090
- traefik.http.routers.prometheus.tls.certresolver=leresolver