Add 'proxy_pass_header' directive

Signed-off-by: Gabriel M. Dutra <me@dutralabs.xyz>
This commit is contained in:
Gabriel M. Dutra 2024-07-22 00:06:45 -03:00
parent 1720e84342
commit aae6e09105
No known key found for this signature in database
GPG key ID: E9480A9E598F3302

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,