diff --git a/src/app.ts b/src/app.ts index 2d7a4e9..c5a4a68 100644 --- a/src/app.ts +++ b/src/app.ts @@ -108,8 +108,10 @@ app.use(CaptainConstants.netDataRelativePath, function(req, res, next) { req.originalUrl.indexOf(CaptainConstants.netDataRelativePath + '/') !== 0 ) { + let isRequestSsl = req.secure || req.get('X-Forwarded-Proto') === 'https' + let newUrl = - 'http://' + + (isRequestSsl? 'https://' : 'http://') + req.get('host') + CaptainConstants.netDataRelativePath + '/'