I using NGINX Ingress Controller in Kubernetes cluster, need to hide the Nginx version information for the client request. since Nginx configuration file generated dynamically. What is the best way to include below line in nginx.conf file?
server_tokens off
Thanks SR
If you look at the configs you'll see that server_tokens
can be either in the http, server, location
contexts in your nginx.conf
. So, on the nginx ingress controller to it really depends on where you want to add that setting (and how):
http context means for all configs in the ingress controller so you'd have to change in the nginx ingress controller config map using the http snippet option.
server context can be done either through the server-snippet ConfigMap option or the server-snippet annotation on a per Ingress basis.
location context can be done either through the location snippet ConfigMap option or the configuration snippet on a per Ingress basis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With