Add 'proxy_pass_header' directive (#11671)

Signed-off-by: Gabriel M. Dutra <me@dutralabs.xyz>
This commit is contained in:
Gabriel M. Dutra 2024-07-22 11:08:30 -03:00 committed by Ricardo Katz
parent 447e0d5036
commit 796621ccaf

View file

@ -229,6 +229,10 @@ func (c *Template) buildHTTP() {
httpBlock = append(httpBlock, buildMapDirective("$http_x_forwarded_for", "$full_x_forwarded_for", forwardForMap))
}
if cfg.AllowBackendServerHeader {
httpBlock = append(httpBlock, buildDirective("proxy_pass_header", "Server"))
}
c.config.Parsed = append(c.config.Parsed, &ngx_crossplane.Directive{
Directive: "http",
Block: httpBlock,