Yeah, you must use the canonical form of the header fields, which means uppercase for the first letter of each part separated by dashes.
The placeholder replacer is doing a lookup for the header in the response by the exact case you told it to, but only the canonical form will work because that’s how they’re stored in the header map.
The code that sets up the replacer looks like this:
// set up the replacer so that parts of the original response can be
// used for routing decisions
for field, value := range res.Header {
repl.Set("http.reverse_proxy.header."+field, strings.Join(value, ","))
}
repl.Set("http.reverse_proxy.status_code", res.StatusCode)
repl.Set("http.reverse_proxy.status_text", res.Status)
So you can see that we’re setting these to the field
name of the header, which is the canonical form, so your placeholders (and by proxy, copy_headers
because it’s just a shortcut for setting up these placeholders) needs to use the canonical form as well.
In some other places like the header
directive, it’ll let you use whatever, because we can canonicalize the inputs before using them. But the replacer is just some string replacement magic.