From 796621ccaf981b7cd7b52465813f245e77a9b75d Mon Sep 17 00:00:00 2001 From: "Gabriel M. Dutra" Date: Mon, 22 Jul 2024 11:08:30 -0300 Subject: [PATCH] Add 'proxy_pass_header' directive (#11671) Signed-off-by: Gabriel M. Dutra --- internal/ingress/controller/template/crossplane/http.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ingress/controller/template/crossplane/http.go b/internal/ingress/controller/template/crossplane/http.go index 8a9e61b8b..7c5ddb693 100644 --- a/internal/ingress/controller/template/crossplane/http.go +++ b/internal/ingress/controller/template/crossplane/http.go @@ -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,