Commit f27d26f4 authored by Dominic Tarr's avatar Dominic Tarr

changeOrigin option: set the host header to the proxy destination

parent b4d41c36
......@@ -194,7 +194,9 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
outgoing.method = req.method;
outgoing.path = req.url;
outgoing.headers = req.headers;
outgoing.headers.host = this.target.host + (this.target.port == 80 ? '' : ':' + this.target.port)
if(this.changeOrigin)
outgoing.headers.host = this.target.host + (this.target.port == 80 ? '' : ':' + this.target.port)
//
// Open new HTTP request to internal resource with will act
// as a reverse proxy pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment