Closed jeffsawatzky closed 6 years ago
Apparently setting:
changeOrigin: true
fixes the issue without having to specify the headers. Still, though, why isn't this the default behaviour?
in version 0.1.11, changeOrigin seems to have broken...
Having exact same issue, tried on 0.1.10 as well and still need to add headers.host to make it work.
Same issue here =(
Ditto for 0.2.0. Maybe it's the new way. Adding this here in case it's driving someone crazy like it did me.
I had to include "headers":
proxies: [{
context: '/api', // the context of the data service
host: 'tidespy.com', // wherever the data service is running
port: 80, // the port that the data service is running on
headers: {
'host': 'tidespy.com'
}
}],
I don't even get a request sent unless I add the host header...
Packet capture with wireshark verifies, without host header, it opens connections but never sends the HTTP request...
here is my config:
Which works, and successfully proxies all XHR requests to
http://localhost:8000/otherapi
tohttp://www.other.com/api
. However, without the headers option, the proxy doesn't work. The request is sent to the ip forwww.other.com
but the host header is stilllocalhost:8000
and the api request fails. I had to add the extra host header to get it to work, which I don't think should be required.