reverseproxy: Add placeholder for host in active health check headers (#6440)

This commit is contained in:
Francis Lavoie 2024-07-06 12:43:19 -04:00 committed by GitHub
parent c3fb5f4d3f
commit 7142d7c1e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -386,6 +386,7 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, upstre
// set headers, using a replacer with only globals (env vars, system info, etc.)
repl := caddy.NewReplacer()
repl.Set("http.reverse_proxy.active.target_host", hostAddr)
for key, vals := range h.HealthChecks.Active.Headers {
key = repl.ReplaceAll(key, "")
if key == "Host" {