-
Notifications
You must be signed in to change notification settings - Fork 34
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
Host header not respected when calling upstream server #2
Comments
@tjsousa Thanks for the report! I would say that this should be handled in HTTPoison and/or Hackney, but there's an unknown amount of time to get that fixed upstream. Saying that, we could most likely handle this inside of ReverseProxy, but that's not the most ideal/optimal solution. To be honest, I'd be up for switching to HTTPotion/ibrowse if it's a better fit. I just used HTTPoison because it's what I've always used. Thoughts? |
I agree. I opened an issue in HTTPoison for it: edgurgel/httpoison#100, but seems like solving it upstream is the way to go. I also have a fix in place for ReverseProxy where I'm basically capitalizing all headers before sending them to Being too new to Elixir to make the Thank you so much for your quick reply and feedback. |
I haven't completed any performance benchmarks on this project before, but this project will probably never win any competitions against reverse proxies written with more low-level code. That said, here are the hypothetical limiting factors:
In order to maximize performance of ReverseProxy as a reverse proxy (as the project stands today), these would be ideal:
I'm by no means an expert in creating reverse proxies, so this list probably isn't 100% complete/valid but is at least a proper starting point. I see a project like ReverseProxy being beneficial by leveraging the BEAM as a distributed reverse proxy. This is a half-baked idea of mine, but it could potentially provide consistency, availability, and partition tolerance that outweighs any performance penalties. |
This fixes a bug here: slogsdon#2
I tried to use the embedded plug strategy inside a Phoenix app and run into an issue where the client set
Host
header wouldn't be respected in the upstream request.I digged into it and found this to be caused by benoitc/hackney#114, as
:hackney
only looks for theHost
header before overriding it. Since the headers are being set from aPlug
connection, they're lower-cased by default.I tried HTTPotion as a client and the headers seem to be respected. Any thoughts on the best approach to overcome this issue?
The text was updated successfully, but these errors were encountered: