Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/nginx-ingress] Pass correct headers to downstream applications when letting AWS terminate SSL. #23559

Closed
wants to merge 1 commit into from

Conversation

don-code
Copy link

What this PR does / why we need it:

The README offers a sample configuration for terminating SSL with an ELB on AWS's side. When this configuration is used, the header X-Forwarded-Proto is rewritten by nginx to always be http (what nginx sees), rather than http or https (what the ELB saw).

Some example behaviors I observed as a result:

  1. Jenkins would redirect to the non-SSL endpoint when logging in, and also show the "It appears that your reverse proxy set up is broken." message in settings.
  2. An internal application could not process POSTs unless they came in over plain HTTP (which caused other issues, as it wanted those POSTs to come in over HTTPS for security).

Setting use-forwarded-headers to true, and use-proxy-protocol to false in the ingress controller config corrects this, so that X-Forwarded-Proto reads http for a plain HTTP session, and https for an HTTPS session.

Since the behavior as-documented seemed broken, I chose to add these two parameters to the documentation.

Which issue this PR fixes

N/A

Special notes for your reviewer:

The link in the documentation was also broken, so I updated it.

I don't know if the broken config is correct in some other context, but I can't think of one, and it seems like it was just oversight.

Checklist

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [stable/mychartname])

…inate SSL.

The README offers a sample configuration for terminating SSL with an
ELB on AWS's side. When this configuration is used, the header
`X-Forwarded-Proto` is rewritten by nginx to always be `http` (what
nginx sees), rather than `http` or `https` (what the ELB saw).

Some example behaviors I observed as a result:
1) Jenkins would perform an "SSL downgrade" when logging in, and also show
   the "It appears that your reverse proxy set up is broken."
2) An internal application would not be able to process POSTs unless they
   came in over plain HTTP.

Setting `use-forwarded-headers` to true, and `use-proxy-protocol` to
false in the ingress controller config corrects the operation.

Since the behavior as-documented seemed broken, I chose to add these two
parameters to the documentation.

Signed-off-by: Don Luchini <[email protected]>
@helm-bot helm-bot added Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 17, 2020
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 17, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @don-code. Thanks for your PR.

I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: don-code
To complete the pull request process, please assign taharah
You can assign the PR to them by writing /assign @taharah in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@scottrigby
Copy link
Member

/hold

See kubernetes/ingress-nginx#6038

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 19, 2020
@scottrigby
Copy link
Member

stable/nginx-ingress has been deprecated in favor of the upstream ingress-nginx repo. See #22823. PRs if still applicable can be re-opened there. Thanks 😊

@scottrigby scottrigby closed this Aug 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants