From ef360d6927feda99ecc0ae9b1cedc3a447433e26 Mon Sep 17 00:00:00 2001 From: Waldemar Reusch Date: Mon, 19 Jun 2017 06:12:36 +0200 Subject: [PATCH] enable verdaccio behind a https nginx proxy (#222) * enable verdaccio to run with http protcol behind a https reverse proxy * add semicolon --- lib/index-web.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/index-web.js b/lib/index-web.js index fc9a5ad6f..255c7fa06 100644 --- a/lib/index-web.js +++ b/lib/index-web.js @@ -45,7 +45,8 @@ module.exports = function(config, auth, storage) { template = Handlebars.compile(fs.readFileSync(require.resolve('./GUI/index.hbs'), 'utf8')); } app.get('/', function(req, res, next) { - let base = Utils.combineBaseUrl(req.protocol, req.get('host'), config.url_prefix); + let proto = req.get('X-Forwarded-Proto') || req.protocol; + let base = Utils.combineBaseUrl(proto, req.get('host'), config.url_prefix); res.setHeader('Content-Type', 'text/html'); storage.get_local(function(err, packages) {