-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Updating from/to www redirect to use X-Forwarded-Proto #7623
Updating from/to www redirect to use X-Forwarded-Proto #7623
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
@aloisbarreras: 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/test-infra repository. |
Welcome @aloisbarreras! |
Hi @aloisbarreras. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Just signed the CLA |
@cmluciano @ElvinEfendi any feedback on this? |
@cmluciano @ElvinEfendi bumping this |
@cmluciano @ElvinEfendi bump |
@cmluciano @ElvinEfendi hello |
/assign |
I ran this PR locally and the failing test I saw was goroutine 1 [running]:^M
sigs.k8s.io/controller-runtime/pkg/internal/testing/addr.init.0()^M
/go/src/k8s.io/ingress-nginx/.modcache/sigs.k8s.io/controller-runtime@v0.9.5/pkg/internal/testing/addr/manager.go:51 +0xda^M
FAIL k8s.io/ingress-nginx/internal/ingress/controller/store 0.025s^M |
e2e test suite passed for me and all the k8s test passes in ci. |
e2e passes locally for me as well
|
awesome thank you for taking the time to review this. Is there anything else you need from me to get this merged? @strongjz |
Hey @strongjz is there anything you need here? |
how's it going @strongjz |
🎵 🎵 All I want for christmas is you 🎵 🎵 to merge this PR |
how's it going @rikatz |
yo yo @rikatz how's it going |
hey @aloisbarreras sorry. I'm on a real rush this week. Wont make any promise but will try to prioritize this one ok? Thanks! |
Also I'm aware this PR took too long already and we should do something fast to review and get it merged, it's just about a lack of time here :/ |
awesome thank you! :) |
sorry for the delay, seems solid! thanks /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aloisbarreras, rikatz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
When running nginx ingress behind a load balancer (AWS ALB) that terminates SSL and using the following annotations:
the ingress controller will incorrectly redirect the request from HTTPS -> HTTP for the from/to www redirect.
For example, a request to https://mysite.com will respond with a 308 to http://www.mysite.com.
I believe this is because the code uses
ngx.var.scheme
in theredirect_to
value. Because the ingress controller is behind an external load balancer, thescheme
is always HTTP. I am updating the logic to use theX-Forwarded-Proto
value if the configmap optionuse-forwarded-headers
is set to true.Types of changes
How Has This Been Tested?
I have tested this in AWS with the above mentioned set up and can confirm that my changes will redirect to the appropriate scheme.
Checklist:
When running
make test
there is one test that fails to pass for me, but it doesn't seem to have anything to do with my changes. The test fails even when running onmain
so it's probably something to do with my environment set up. Let me know if I need to add/change any tests.