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 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()) })