-
Notifications
You must be signed in to change notification settings - Fork 2k
x-forwarded-proto is set as httpshttps #250
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
Comments
@ryanstevens Wanna PR us this change? I'll pull it. :D |
The ternary was evaluating truthy for "," + req.connection.pair which is always true because its always a non empty string. Wrapped actual condition to properly concatenate the product of the ternary. let me know if you prefer the style (req.connection.pair ? 'https' : 'http') http-party#250
Actually because of that, the code under FAQ "How to force SSL" is not working and causes infinity loop as req.get('X-Forwarded-Proto') !== 'https' always returns false (because it's http,https). |
@grabbou make sure you are using the 1.x.x version of http-proxy |
@jcrugzz thanks for the response, how can I check/change that on nodejitsu? Command line / packages.json settings? For now I only have node engine specified. Actually, I think that forcing SSL's should be done by default if one specified SSL certificates in Nodejitsu dashboard (as it's the only reasonable approach to be honest) |
@grabbou if this is about the nodejitsu product please open a support ticket, this is the wrong context for this conversation. |
ok, thanks |
When receiving proxied traffic from http-proxy the x-forwarded-proto is set as httpshttps.
This line https://github.com/nodejitsu/node-http-proxy/blob/master/lib/node-http-proxy/http-proxy.js#L151
which is currently
var protoToAppend = "," + req.connection.pair ? 'https' : 'http';
needs to be changed to
var protoToAppend = "," + (req.connection.pair ? 'https' : 'http');
With this change, x-forwarded-proto should be set to https,http
The text was updated successfully, but these errors were encountered: