← Back to posts
Fixing Strapi CMS preview issue

Fixing Strapi CMS preview issue

If you trying to setup Strapi CMS and you see this issue with previews

You just need to configure security plugin in the middleware


  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': [
            "'self'", 
            'https:'
          ],
          'img-src': [
            "'self'",
            'data:',
            'blob:',
            'storage.googleapis.com',
            'market-assets.strapi.io'
          ],
          'media-src': [
            "'self'", 
            'data:', 
            'blob:', 
            'storage.googleapis.com',            
          ],
          upgradeInsecureRequests: null,
        },
      }
    }
  },

https://helmetjs.github.io/


https://docs.strapi.io/cms/configurations/middlewares#security