diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 7279824..82bc533 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -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