When receiving HTTP3xx server side redirects, the Location header is not entirely rewritten by the proxy, except for rewriting http to https, but in fact servername and port should be translated as well if they match the backend server and port, to make the process transparent to the browser.
So if the Location header contains http://backendhostname:backendport/foo/bar it should be rewritten to http://proxyhost:proxyport/foo/bar while still applying the http to https conversion as currently implemented.
@nodejitsu Any input on this?
I did write a patch that I should submit.
Would also like to +1 this, especially if someone has a potential fix already (@jayv ?). I came across this issue when using Testacular which relies on http-proxy for http forwarding.
I have a fix that solved my Testacular issues, let me see if I can send you a patch.
@Dignifiedquire @amirhhz I've submitted a pull request that I wrote a couple months ago:
You can install my node-http-proxy fork and link to that one from Testacular, it's how we currently run our tests.