From 764fc04756d62300b365463f1118c174994467f4 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 25 Jul 2022 09:46:26 +0300 Subject: [PATCH] app/vmalert: fix after da10962d4c2d99d8cdadfe4244d9c682c641e5ef --- app/vmselect/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/vmselect/main.go b/app/vmselect/main.go index fd99dd83a2..2d27ea3d5f 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -344,11 +344,12 @@ func selectHandler(qt *querytracer.Tracer, startTime time.Time, w http.ResponseW return true } - if path == "/vmalert" { - http.Redirect(w, r, path+"/", http.StatusMovedPermanently) + if p.Suffix == "prometheus/vmalert" { + path := "../" + p.Suffix + "/" + http.Redirect(w, r, path, http.StatusMovedPermanently) return true } - if strings.HasPrefix(path, "/vmalert/") { + if strings.HasPrefix(p.Suffix, "prometheus/vmalert/") { vmalertRequests.Inc() if len(*vmalertProxyURL) == 0 { w.WriteHeader(http.StatusBadRequest)