Static GitHub Issues

[870] Content flashes then vanishes under HTTPS

prev: Dynamic modules import on client, but server side rendered imidiatly
next: In the nuxt I need the server database related operations, I was in the plugins, or in the middleware?

Hi

I am deploying to Heroku, and using HTTPS. I have a custom server file, with the following middleware function

const forceSsl = (req, res, next) => {
    if (req.headers['x-forwarded-proto'] !== 'https') {
        return res.redirect(['https://', req.get('Host'), req.url].join(''));
    }
    return next();
};

if (process.env.NODE_ENV === 'production'){
    app.use(forceSsl);
}

For some reason, the content displays for a split second then vanishes and I am just left with the footer.

Any ideas? <img width="2560" alt="screen shot 2017-06-10 at 17 48 47" src="https://user-images.githubusercontent.com/12255135/27004680-342916c8-4e05-11e7-80ce-1c2761848b69.png">

The domain is https://www.agencyadvice.co.uk

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c749">#c749</a>)</em></sub></div>