-
Notifications
You must be signed in to change notification settings - Fork 2k
Changing changeOrigin to be true by default #1132
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
here's specs |
Many users of this library (including me) encounter this problem and need to set Not far fetched to say some are just giving up before finding out about the changeOrigin flag. |
An approaching solution would be to improve the error message, to point to some documentation about this setting. This is what I got:
which is not very helpful to find the solution ( |
As mentioned by @bdefore and @kdepp in #851, changeOrigin should be set to true by default.
The very first reason is simply to be compatible with the HTTP 1.1 specifications that requires a Host header. If a proxy listen on foobar.com and proxies request to bargee.net, then every requests sent to bargee.net must have a Host header set:
Host: bargee.net
.In turns, by fixing the inconsistencies generated by
changeOrigin=false
, it will enable all virtual host environment to serve request correctly. This is the case for example when using http-proxy via grunt-connect-proxy that even dropped support for changeOrigin and requires injecting forcefully the host header.IMHO, it would even be better to get rid of that option completely and consider it is always true.
The text was updated successfully, but these errors were encountered: