thanos: Thanos rule doesn't honor --web.external-prefix
Thanos, Prometheus and Golang version used:
# thanos --version
thanos, version 0.15.0 (branch: HEAD, revision: fbd14b49f95e7543883fedf9381a21127d4dda2b)
build user: root@d35b081d3e19
build date: 20200907-09:29:21
go version: go1.14.2
#
What happened:
Running Thanos Rule behind Nginx, with --web.external-prefix=https://external.com/thanos/rule, so that Rule is accessible at https://external.com/thanos/rule. The result is https://external.com/thanos/rule directs to https://external.com/thanos/rule/alerts . It opens up but it is in “text mode”, style sheet (css) not loaded.
The links in the UI:
-
Alerts directs to https://external.com/thanos/rule//thanos/rule/alerts and getting “404 page not found”
-
Rules directs to https://external.com/thanos/rule//thanos/rule/rules and getting “404 page not found”
-
Help opens in a new tab https://thanos.io/tip/thanos/getting-started.md/ and getting to Thanos documentation
-
New UI opens a new tab https://external.com/thanos/rule//thanos/rule/new/ and getting “404 page not found”
Opening https://external.com/thanos/rule/rules opens the rules but again style sheet not loaded. Opening https://external.com/thanos/rule/new/ redirects to https://external.com/thanos/rule/new/alerts and displays “Error: Error fetching Alerts: Failed to fetch”, the style sheet is loaded.
Links in the new UI:
- Alerts directs to https://thanos/rule/new/alerts
- Rules directs to https://thanos/rule/new/rules
- Classic UI directs to https://thanos/rule/alerts
http://internal.org:19902 redirects to http://internal.org:19902/thanos/rule/alerts http://internal.org:19902/alerts opens up but it is in text mode, style sheet (css) not loaded.
What you expected to happen:
- https://external.com/thanos/rule/alerts opens with the style loaded
- All the buttons (Alerts, Rules, New UI) direct to the right urls
- New UI Actually works
How to reproduce it (as minimally and precisely as possible):
- Run Thanos Rule with --web.external-prefix=https://external.com/thanos/rule on host internal.org
- Configure Nginx for Query on host external.com with the following:
location /thanos/rule/ {
proxy_pass http://internal.org:19902/;
}
- Open up your browser, go to https://external.com/thanos/rule and try switching to “Alerts”, “Rules”, “New UI”.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (5 by maintainers)
@prmsrswt using v0.16.0, for the Query, no matter if I configure --web.external-prefix=/thanos or --web.external-prefix=thanos, for both cases I’m redirected to “/thanos/graph” and I get “404 page not found”. The “/thanos/metrics”, for example, is working fine. What happened to graph?