feat: use destination path as prefix when rewritting url
Cadoles/bouncer/pipeline/head This commit looks good Details

This commit is contained in:
wpetit 2024-06-24 17:18:31 +02:00
parent 19fda6aa64
commit 1009eb19aa
1 changed files with 6 additions and 0 deletions

View File

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