linkerd2 web does not support relative paths
Bug Report
I want to be able to proxy the web UI in a subdirectory or kubectl proxy, but it currently requires to be at the root path. That is a bug.

What is the issue?
How can it be reproduced?
Logs, error output, etc
(If the output is long, please create a gist and paste the link here.)
linkerd check output
kubernetes-api: can initialize the client..................................[ok]
kubernetes-api: can query the Kubernetes API...............................[ok]
kubernetes-api: is running the minimum Kubernetes API version..............[ok]
linkerd-api: control plane namespace exists................................[ok]
linkerd-api: control plane pods are ready..................................[ok]
linkerd-api: can initialize the client.....................................[ok]
linkerd-api: can query the control plane API...............................[ok]
linkerd-api[kubernetes]: control plane can talk to Kubernetes..............[ok]
linkerd-api[prometheus]: control plane can talk to Prometheus..............[ok]
linkerd-api: no invalid service profiles...................................[ok]
linkerd-version: can determine the latest version..........................[ok]
linkerd-version: cli is up-to-date.........................................[ok]
linkerd-version: control plane is up-to-date...............................[ok]
Status check results are [ok]
Environment
- Kubernetes Version:
- Cluster Environment: (GKE, AKS, kops, ...)
- Host OS:
- Linkerd version: Client version: stable-2.1.0 Server version: stable-2.1.0
Possible solution
Use a relative path of dist instead of /dist and so on.
Additional context
I'd very much like to be able to get to the dashboard through a reverse proxy and really need to be able to support relative paths or the ability to set a root_url path that everything then uses.
Thanks @robertrbruno @ctaggart!
This relates to #1696, which explores the idea of accessing the dashboards via port-forward, which would make the web/grafana setup more straightforward and hopefully allow us to support relative paths.
@klingerf I see #1696 was fixed a week ago by #2052. Any chance this was or can also be resolved? I can't get linkerd back into our labs until this is resolved.
In #2052 we moved to using port-forward, which means that the web UI is served from "/" and the grafana UI is served from "/grafana", but neither support being served on arbitrary paths, so I'm afraid this issue is still not fixed. The main benefit from #2052 is that you can now expose both web and grafana via an ingress controller. If serving on arbitrary paths is still required, then that would require additional code changes, and I'd welcome a PR for such a change.
Is there any update on supporting the use of Linkerd web on relative paths?
@lyndon160 Curious if using the ingress approach will serve your needs here?
@lyndon160 this issue is still open. We'd love PRs!
@ihcsim the problem is because of the SPA and URL paths.
Use a relative path of dist instead of /dist and so on.
This unfortunately won't quite cut it with the current setup, and in fact will break the app. The problem is that the backend is handling every route on the initial request and serving the SPA from there.
That means when requesting /namespaces/linkerd, instead of pointing to /dist/index_bundle.js, the bundle would point to /namespaces/linkerd/dist/index_bundle.js, which is obviously wrong.
IMHO the underlying problem is how routing is done. It probably should be handled by the frontend, especially since almost all the current backend routing is calling the same handler (handleIndex). Unless there is a really, really good reason not to.
After that, using relative path's for assets and React-Router's basename would fix the issue.
Let me take this issue @ctaggart Please assign
Hi @ashutosh887,
You don't need this issue assigned in order to start work on it. Feel free to just submit a PR or reach out if you have questions.