-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
query: --web.route-prefix makes UI inaccessible #2581
Comments
Okay so I tried looking into this and I have got some observations that can help us. Setting the Setting the So going back to route prefix, if we use The bug lies in the templates we use for the WebUI. For example in <link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/static/css/graph.css?v={{ buildVersion }}">
A simple workaround is setting For a proper solution we can remove the forward slash after /* graph.html */
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}static/css/graph.css?v={{ buildVersion }}"> // pkg/ui/query.go
func (q *Query) graph(w http.ResponseWriter, r *http.Request) {
prefix := GetWebPrefix(q.logger, q.externalPrefix, q.prefixHeader, r)
if prefix != "" {
prefix := prefix + "/"
}
q.executeTemplate(w, "graph.html", prefix, nil)
} |
Thanos, Prometheus and Golang version used:
Object Storage Provider:
N/A
What happened:
I have specified
--web.route-prefix
asFOO
by:--web.route-prefix=FOO
. Then, I went to http://localhost:10902/FOO.What you expected to happen:
Expected the user interface to load. Instead, I got a 404.
How to reproduce it (as minimally and precisely as possible):
Run
./thanos query --web.route-prefix="test"
. Go to http://localhost:10902/test.Full logs to relevant components:
N/A
Anything else we need to know:
ATM when you specify
FOO
as--web.route-prefix
then:/
to/FOO
/FOO
a permanent redirect is registered viaq.root
to/graph
/graph
is actually registered on/FOO/graph
Making an ad-hoc change to
q.root
like this:Makes the UI available on http://localhost:10902/test again to some degree.
The assets are still being loaded from
/static
, not/test/static
but that's another problem. I'd expect to see a fully functional UI but that hasn't worked on 0.11.x as well. To get a fully functional UI, you also need to specify--web.external-prefix="/test"
. But maybe that's by design.The text was updated successfully, but these errors were encountered: