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:

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:

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:

  1. https://external.com/thanos/rule/alerts opens with the style loaded
  2. All the buttons (Alerts, Rules, New UI) direct to the right urls
  3. New UI Actually works

How to reproduce it (as minimally and precisely as possible):

  1. Run Thanos Rule with --web.external-prefix=https://external.com/thanos/rule on host internal.org
  2. Configure Nginx for Query on host external.com with the following:
  location /thanos/rule/ {
    proxy_pass http://internal.org:19902/;
  }
  1. 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)

Most upvoted comments

@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?