From 1009eb19aae235bb78b94118d59a7d1d7eedb7f6 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 24 Jun 2024 17:18:31 +0200 Subject: [PATCH] feat: use destination path as prefix when rewritting url --- internal/proxy/director/director.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/proxy/director/director.go b/internal/proxy/director/director.go index 32458d6..89da473 100644 --- a/internal/proxy/director/director.go +++ b/internal/proxy/director/director.go @@ -70,6 +70,7 @@ MAIN: r.URL.Host = toURL.Host r.URL.Scheme = toURL.Scheme + r.URL.Path = toURL.JoinPath(r.URL.Path).Path ctx = logger.With(ctx, logger.F("proxy", match.Name), @@ -77,6 +78,11 @@ MAIN: logger.F("remoteAddr", r.RemoteAddr), ) + logger.Debug( + ctx, "rewritten url", + logger.F("rewrittenURL", r.URL.String()), + ) + metricProxyRequestsTotal.With(prometheus.Labels{metricLabelProxy: string(match.Name)}).Add(1) ctx = withProxy(ctx, match)