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

Parse X-Forwarded-Port and X-Forwarded-Proto #4

Open
edevil opened this issue Aug 4, 2017 · 3 comments
Open

Parse X-Forwarded-Port and X-Forwarded-Proto #4

edevil opened this issue Aug 4, 2017 · 3 comments

Comments

@edevil
Copy link

edevil commented Aug 4, 2017

Besides the real client IP there are other headers that are also interesting to parse such as the real remote port and protocol used. This is useful in situations in which the proxy is terminating the SSL for you.

@ajvondrak
Copy link
Owner

This would be a nice to have, but I'm not sure it's really in the scope of this plug. At least the name would be misleading. 😛

@ericlathrop
Copy link

Plug.SSL is capable of rewriting the other headers, but it also forces a redirect to HTTPS, which I don't want because it's causing problems with my load balancer's health checks (that don't include X-Forwarded-Proto)

@almirsarajcic
Copy link

almirsarajcic commented Jun 8, 2020

@ericlathrop, you can add your load balancer's IP to :excluded list (https://github.com/elixir-plug/plug/blob/master/lib/plug/ssl.ex#L47) to prevent redirection.
I'm using that on Kubernetes with pod IP and node IP in the exclusion list.

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

No branches or pull requests

4 participants