-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
proxy_set_header does not seem to work on http-level #12422
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
I can think of a couple of ways
controller:
config:
http-snippet: |
map $http_x_correlation_id $correlation_id {
default $http_x_correlation_id;
"" $req_id;
}
ingressClass: internal # If you use different ingress classes
ingressClassByName: true
controller:
config:
http-snippet: |
map $http_x_correlation_id $correlation_id {
default $http_x_correlation_id;
"" $req_id;
}
server-snippet: |
# Ensures the header is set in the server context
proxy_set_header X-Correlation-ID $correlation_id; |
Thanks for the reply @reethuj!
What is most baffling to me is that the Update: While writing this, I Googled around some more and found the setting So from my point of view, I'm closing this issue. But it's still a bit weird that I can't get |
What happened:
I'm trying to add global configuration for a
X-Correlation-ID
header. I deploy NGINX Ingress Controller with Helm into my Kubernetes cluster, and I have this configuration (non-relevant config omitted):I would expect any upstream pod to receive the
X-Correlation-ID
header. But they just don't get it. They do get it if I pass it in from the outside world, but I need the fallback to work throughout my chain of services.I've also tried with using the
nginx.ingress.kubernetes.io/server-snippet
annotation on theIngress
resource (which I would like to avoid, because I want a global configuration for all my services):This does not work either. What does work, however, is the
nginx.ingress.kubernetes.io/configuration-snippet
annotation, like this:As far as I can see in the generated
nginx.conf
, there is nothing else that should conflict with this.What you expected to happen:
I would expect the
X-Correlation-ID
header to be passed in to my upstream pods, based on the fallback I've set up. Both for thehttp-snippet
, but also for theserver-snippet
annotation (not preferred).NGINX Ingress controller version (exec into the pod and run
/nginx-ingress-controller --version
):Helm chart version 4.5.2. But I've also tried with the latest Helm chart, 4.10.1, which is NGINX Ingress Controller v1.10.1.
Kubernetes version (use
kubectl version
):Environment:
uname -a
):Internal:
External (but lets focus on the internal for now):
... and also a bunch of old replica sets.
Too many to name here.
N/A.
How to reproduce this issue:
I don't have a good way of reproducing everything, I'm running with Helm in my created clusters.
Anything else we need to know:
Not that I can think off.
The text was updated successfully, but these errors were encountered: