diff --git a/lib/configproxy.js b/lib/configproxy.js index 8afccd25..f46b6797 100644 --- a/lib/configproxy.js +++ b/lib/configproxy.js @@ -510,6 +510,12 @@ class ConfigurableProxy extends EventEmitter { return; } + // X-Forwarded-Proto may have multiple values, Tornado uses the last but we want the first + if (req.headers['x-forwarded-proto']) { + req.headers['x-forwarded-proto'] = req.headers['x-forwarded-proto'].split(',')[0]; + that.log.debug('Using first x-forwarded-proto: ' + req.headers['x-forwarded-proto']) + } + if (kind === "web") { that.emit("proxyRequest", req, res); }