From 5449af70af51db980ecc4575b579fceb7f8c8a69 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Thu, 23 Oct 2025 09:43:07 +0200 Subject: [PATCH] Revert "UI: fix redirect when web.routePrefix configured" This reverts commit 93887a9b82a71613067ff0706248c18fe131c5b0. See discussion at https://github.com/prometheus/prometheus/pull/17240 - I had thought this was a simple and clear bugfix, but multiple people were depending on the previous behavior already, and we want to err on the side of stability. Signed-off-by: Julius Volz --- web/web.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/web.go b/web/web.go index 22a0098878..80aa845883 100644 --- a/web/web.go +++ b/web/web.go @@ -417,12 +417,12 @@ func New(logger *slog.Logger, o *Options) *Handler { readyf := h.testReady router.Get("/", func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, path.Join(o.RoutePrefix, homePage), http.StatusFound) + http.Redirect(w, r, path.Join(o.ExternalURL.Path, homePage), http.StatusFound) }) if !o.UseOldUI { router.Get("/graph", func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, path.Join(o.RoutePrefix, "/query?"+r.URL.RawQuery), http.StatusFound) + http.Redirect(w, r, path.Join(o.ExternalURL.Path, "/query?"+r.URL.RawQuery), http.StatusFound) }) }