-
Notifications
You must be signed in to change notification settings - Fork 617
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
Sync X-Forwarded-Proto and Forwarded header when possible #296
Comments
I think the |
I am quoting from the RFC 7239:
So obviously this is not what happens in fabio. As I described above the Ok admittedly, in my case the "crypto offloading" is done one layer above in the AWS loadbalancer. However, shouldn't we still forward the correct the user agent's "connection type" origin/upstream server? |
The main problem is that the AWS LB sets some but not other headers which leads to the discrepancy. But fabio also uses the actual connection type to determine the scheme which can only work reliably when the connection is terminated on fabio. We could use the following heuristic to determine the
We might need to look at the remote ip as well even though this doesn't affect the AWS case since it uses the PROXY protocol. |
I think this heuristic is flawed for case 2. When both headers are present fabio should not touch them since it isn't clear which is the source of truth. |
I've pushed a change with the described behavior. Could you test it, please? |
proto
I have tested your change and it's working now. Also I agree with your objection to case 2. It's probably better to not change anything, if both headers are passed to fabio |
I have somewheat similar problem, though I get |
Situation:
http
X-Forwarded-For: x.x.x.x
X-Forwarded-Proto: https
Forwarded: for=x.x.x.x; proto=http; by=y.y.y.y
Now my application wrongly assumes that the "real" request is made via
http
and nothttps
, because it consumes theForwarded
if its present, instead ofX-Forwarded-For|Proto
.I am not sure if it's a problem in my application, or in fabio, as there's a discrepancy in both headers:
X-Forwarded-Proto
says it'shttps
Forwarded
says it'sproto=http
The text was updated successfully, but these errors were encountered: