Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nginx] configmap config server-tokens=false only removes version #1094

Closed
stp-ip opened this issue Aug 9, 2017 · 3 comments · Fixed by #2696
Closed

[nginx] configmap config server-tokens=false only removes version #1094

stp-ip opened this issue Aug 9, 2017 · 3 comments · Fixed by #2696

Comments

@stp-ip
Copy link
Member

stp-ip commented Aug 9, 2017

The configmap configuration for nginx "server-tokens" is only removing the version instead of the whole nginx Server header. I would expect it to actually remove it completely.

@rikatz
Copy link
Contributor

rikatz commented Aug 21, 2017

Actually this is a behaviour of NGINX, not Ingress or nginx.conf itself.

What you can do is use 'more_set_headers' to change your 'Server' value, as the following:

more_set_headers 'Server: BlaServer';

Change this in your nginx.tmpl and it will work as expected.
Probably there's also another way to do this, using something in ConfigMap as described here

Take a look to see if this is what you're looking for.

@stp-ip
Copy link
Member Author

stp-ip commented Aug 23, 2017

Seems like a good enough workaround and we shouldn't go another way, when nginx upstream is using it like that. Thanks for the workaround.

@stp-ip stp-ip closed this as completed Aug 23, 2017
@bfin
Copy link
Contributor

bfin commented May 1, 2018

@stp-ip The ingress-nginx controller is built with the headers-more-nginx-module so you can use the more_clear_headers directive to completely remove the server output header:

more_clear_headers Server;

https://github.com/openresty/headers-more-nginx-module#more_clear_headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants