Skip to content
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

Passing header X-Forwarded-Proto:https from client breaks SSL redirect #1779

Closed
jpalomaki opened this issue Nov 30, 2017 · 2 comments · Fixed by #1844
Closed

Passing header X-Forwarded-Proto:https from client breaks SSL redirect #1779

jpalomaki opened this issue Nov 30, 2017 · 2 comments · Fixed by #1844

Comments

@jpalomaki
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

NGINX Ingress controller version: 0.9.0-beta.19

Kubernetes version (use kubectl version): 1.8.4-gke.0

Environment:

  • Cloud provider or hardware configuration: GKE

What happened:

http http://example.com/ 'X-Forwarded-Proto:https'
HTTP/1.1 200 OK

What you expected to happen:

http http://example.com/ 'X-Forwarded-Proto:https'
HTTP/1.1 301 Moved Permanently
...
Location: https://example.com/

How to reproduce it (as minimally and precisely as possible):

nginx.ingress.kubernetes.io/ssl-redirect: "true"

Anything else we need to know:

Using GCP network load balancer (no proxy).

I've also tried adding to nginx configmap (to no avail):

http-snippet: >
    more_clear_input_headers X-Forwarded-For X-Forwarded-Host X-Forwarded-Proto X-Forwarded-Port;
@aledbf
Copy link
Member

aledbf commented Nov 30, 2017

@jpalomaki can you test this from the ingress controller pod itself using the next command?

kubectl exec -it <nginx ingress pod> -- curl -v http://localhost \
  -H 'Host: example.com' -H 'X-Forwarded-Proto: https'

@jpalomaki
Copy link
Author

@aledbf Same deal, no redirect when passing -H 'X-Forwarded-Proto: https'. If I remove said header, I get the redirect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants