-
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-headers appends instead of overwriting #3481
Comments
@xcq1 what are the relevant configmap, annotations configuration snippets? Can you paste them verbatim? |
@dcherniv I think these would be the relevant bits:
Port 8000 has also been opened on the deployment. |
I think this is the default proxy_set_header behavior in nginx. |
Just found out
Which in this case leads to problems because the appended headers are not valid: I got around this for now by replacing add_headers in line 219 of the nginx.tmpl with your suggestion more_set_headers. However it's not exactly clear to me where I would replace proxy_set_header with more_set_headers to solve it for the |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Running into this on our ingress which runs on port 80 behind an SSL proxy that incorrectly sends us an |
/remove-lifecycle rotten @fdlk In case it might help you: We ended up workarounding this by hard patching the default It works if you have no HTTP-only connections, however it isn't going to win any beauty awards. And you have to accept the fact that any version upgrade can theoretically break your config. This is the patch:
Which is then deployed like so: |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
The upgrade in a44b5cf did not work for me. What did work was adding the header as so:
|
Ok my problem with X-Forwarded-Proto was not caused by ingress-nginx but by the AWS ALB in front of it. |
How did you fix it in ALB? |
@prcongithub
It makes sense, especially if you force a http => https redirect somewhere between your edge and ingress-nginx ( both included ). |
I just fixed it in kong. Had to add trusted_ips in kong configuration to allow X-Forwarded-* headers to pass through. I am using https everywhere. ALB redirects http to https. SSL Terminates at ALB and connects with Kong using HTTP. But if I enable trusted_ips, kong passes X-Forwarded-* headers with correct values. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
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/test-infra repository. |
@xcq1 wondering how could this work, I see the variables set in "server" blocks are always overridden by "location", so such $pass_access_scheme and $pass_port will be reverted, here's what I see in each of my location block
|
Is this still not fixed?
I need to change header Host and I use this:
and as result I get concatenated hosts - Host: host1.com, host2.com |
Is this a request for help? No
What keywords did you search in NGINX Ingress controller issues before filing this one? proxy-set-headers, overwrite, override, add-headers
Is this a BUG REPORT or FEATURE REQUEST? Bug Report
NGINX Ingress controller version: 0.21.0
Kubernetes version (use
kubectl version
): 1.10.9Environment:
What happened:
My instance of ingress-nginx is running behind an AWS ELB that terminates the TLS connection. Thus all requests show up with the "X-Forwarded-*" headers indicating a plain old HTTP connection. However my backend services generate user-facing URLs from the values supplied from these headers. Therefore, I must change them as if the ingress-nginx had received an HTTPS request so it returns the proper URLs.
In order to do this I have configured the configuration option "proxy-set-headers" to point to a ConfigMap with the following data:
But when I checked on the requests that arrive at an echo server (gcr.io/google_containers/echoserver:1.4) this is what the backend would get: (Values get appended instead of set)
What you expected to happen:
The backend should receive (Values should get replaced)
How to reproduce it (as minimally and precisely as possible): See "What happened"
Anything else we need to know: Can't think of anything, but will answer any follow-up questions
The text was updated successfully, but these errors were encountered: