From ef86b50427f7a30db4ca61dbda990c4caf732863 Mon Sep 17 00:00:00 2001 From: Jakob Backlund Date: Fri, 26 Feb 2016 14:29:55 +0200 Subject: [PATCH] Set the x-forwarded-host flag when xfwd is enabled Reasoning: Rack's request class [makes use of](https://github.com/rack/rack/blob/master/lib/rack/request.rb#L243) this HTTP header. Certain edge-case scenarios (proxying from ember-cli to a Rails backend) can be problematic without this header being present. /cc @perlun, @jesjos --- lib/http-proxy/passes/web-incoming.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/http-proxy/passes/web-incoming.js b/lib/http-proxy/passes/web-incoming.js index af28546..670ac96 100644 --- a/lib/http-proxy/passes/web-incoming.js +++ b/lib/http-proxy/passes/web-incoming.js @@ -78,6 +78,8 @@ web_o = Object.keys(web_o).map(function(pass) { (req.headers['x-forwarded-' + header] ? ',' : '') + values[header]; }); + + req.headers['x-forwarded-host'] = req.headers['host']; }, /**