Configure Ingress controller to forward custom http headers
I ended up using the following configuration snippet:
nginx.ingress.kubernetes.io/configuration-snippet: | proxy_set_header My-Custom-Header $http_my_custom_header;
nginx makes all custom http headers available as embedded variable via the $http_
prefix, see this
If I want my ingress controller pass a custom header to my backend service, I can use this annotation in my ingress rule
nginx.ingress.kubernetes.io/configuration-snippet: | more_set_headers "Request-Id: $req_id";
By default ingress doesn’t pass through headers with underscores.You could set
enable-underscores-in-headers: true
Also Ingress doesn’t pass through Authorization header