enable verdaccio behind a https nginx proxy (#222)

* enable verdaccio to run with http protcol behind a https reverse proxy

* add semicolon
This commit is contained in:
Waldemar Reusch 2017-06-19 06:12:36 +02:00 committed by Meeeeow
parent 9db2372c05
commit ef360d6927
1 changed files with 2 additions and 1 deletions

View File

@ -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) {