Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ingress-nginx allow-backend-server-header not working as expected

The kubernetes ingress-nginx controller adds (or replaces) the server response header by default.

My understanding is that the option allow-backend-server-header was added to pass the default server header through to the client.

Installing with helm:

helm install stable/nginx-ingress \
--namespace ingress-basic \
--set controller.config.allow-backend-server-header="true"

But when I hit my server with nginx in front of it, I am still getting server: openresty/1.15.8.1 in my response headers, when I expect either nothing, or something different.

Am I missing something or is this supposed to work differently than I'm expecting it to?

like image 708
itslittlejohn Avatar asked Jan 24 '26 20:01

itslittlejohn


1 Answers

By default Nginx Ingress will add a header like Server: nginx/1.17.10. If you set

controller.config.allow-backend-server-header="true"

it will allow the Server header from backend server to pass through to client. So I guess you are using openresty as a backend server and hence you are seeing it in the Server header.

like image 101
Rushikesh Avatar answered Jan 27 '26 17:01

Rushikesh