Skip to content

Commit

Permalink
changeOrigin option: set the host header to the proxy destination
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Nov 14, 2011
1 parent b4d41c3 commit f27d26f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f27d26f

Please sign in to comment.