From 3b25f3438f415b8d4443d3542066aac03beaa5c5 Mon Sep 17 00:00:00 2001 From: Brian Findlay Date: Sat, 23 Jun 2018 10:01:33 -0400 Subject: [PATCH 1/2] Replace more_set_headers directive with more_clear_headers --- rootfs/etc/nginx/template/nginx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index ed3409570d..6a41d7b230 100644 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -184,7 +184,7 @@ http { server_tokens {{ if $cfg.ShowServerTokens }}on{{ else }}off{{ end }}; {{ if not $cfg.ShowServerTokens }} - more_set_headers "Server: "; + more_clear_headers Server; {{ end }} # disable warnings From d59e3ee9dd6ce77b2b2a25c160f935bc474fd7a2 Mon Sep 17 00:00:00 2001 From: Brian Findlay Date: Sat, 23 Jun 2018 10:08:39 -0400 Subject: [PATCH 2/2] Update server-tokens tests --- test/e2e/settings/server_tokens.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/settings/server_tokens.go b/test/e2e/settings/server_tokens.go index 894a1caaa9..a5aecd6b81 100644 --- a/test/e2e/settings/server_tokens.go +++ b/test/e2e/settings/server_tokens.go @@ -51,7 +51,7 @@ var _ = framework.IngressNginxDescribe("Server Tokens", func() { err = f.WaitForNginxConfiguration( func(cfg string) bool { return strings.Contains(cfg, "server_tokens off") && - strings.Contains(cfg, "more_set_headers \"Server: \"") + strings.Contains(cfg, "more_clear_headers Server;") }) Expect(err).NotTo(HaveOccurred()) })