Since you're getting a redirect loop I would assume it could be related to a proxy in front of your express server. This could usually be the case if you're using nginx to proxy calls.
What I'm doing is updating the nginx configuration to forward original scheme as a custom header and use that in my express middleware i.e. add this to your site config
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
Then in your express you need to add a middleware looking at this such as
app.use(function(req, res, next) {
if (req.headers['x-forwarded-proto'] !== 'https') {
return res.redirect('https://' + req.headers.host + req.originalUrl);
}
else {
next();
}
});
This should allow you to redirect properly.