-
Notifications
You must be signed in to change notification settings - Fork 43
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
Handle "self" link protocol when proxied #45
Comments
Good catch! I've also used this library behind a proxy, and I think I solved this problem by setting express' Is there some reason not to solve this with |
I didn't know that option existed! This is exactly what I wanted! That option certainly feels like the proper way to handle this case. I cannot think of any issues with using it (the API is completely isolated behind the proxy). As you may be able to discern, I've never used Node/Express behind a proxy before. Thanks for the super quick responses to my issues! This is an extremely helpful library, I really appreciate your work. Let me know if I can contribute in any way besides spamming up the issues section. :) |
I'm glad that worked, and that the library's been useful to yiu! Also, thanks so much for your offer to contribute; your help would certainly be appreciated! Are there any open issues you might want to take a stab at? |
#17 looks like it would be very helpful to me in the near future. When I start the next phase of my project, I'll do some exploring into that issue and see what I can come up with. |
Awesome! Thanks Michael! |
I currently have json-api setup behind a Nginx proxy. The proxy sets up a SSL tunnel. All the clients speak only over HTTPS, but everything behind the proxy is only HTTP.
Self links derive their protocol from the incoming request protocol only. The simple fix is to use the traditional
X-Forwarded-Proto
header instead (if set).There is probably a better way to handle this, but I'd like to get your thoughts before I post a PR. I just change this line to this:
The text was updated successfully, but these errors were encountered: