quick question here. I'm quite new to Traefik and would like to rather expose the Traefik dashboard under
example.com/traefik rather than
I have tried a few options unsuccessfully so far. Furthermore, the
As underlined in the
documentation for the , the
router rule defined for Traefik must match the path prefixes
We recommend to use a "Host Based rule" as
) to match everything on the host domain
So can I expose the dashboard (and the api) on a specific prefix or not at all ?
Thanks for the information!
There's good reason for that.
The application "dashboard" makes relative requests to
/dashboard from your client. So your path of
/traefik will not work.
You might have misunderstood the word "
If you are concerned about security. Add
basicAuth middleware to secure your dashboard.
@jnovack and thanks for your prompt answer
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
/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
rule = "PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
You can still control the other near infinite possibilities (minus 2).
There's the other possibility using
on your other services.
Does that work for Prometheus and Grafana (et al.)?
In fact, that will do, thanks.
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
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:
# Expose the metrics on the reserved sub path, TLS is provided by the Let's Encrypt cert provider.
- job_name: 'prometheus'
- targets: ['localhost:9090']
I know... I know...
It was more that it is also in huge, bold, with big warnings a few times in the documentation.
But thanks for the tip though.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.