1

I just deployed my strapi cms to heroku, and the problem is when I add assets into media library, the images will not showing after few minutes, it looks like this

The URL of the images exists on the API, but when I check it manually, it shown 'not found' message. Any solution of this case?

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Jul 17, 2022 at 4:41

1 Answer 1

2

This Issue may be solved. According to the @strapi/provider-upload-cloudinary documentation

According to that, we need to add the below code to ./config/middlewares.js file.

module.exports = [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': ["'self'", 'data:', 'blob:', 'dl.airtable.com', 'res.cloudinary.com'],
          'media-src': ["'self'", 'data:', 'blob:', 'dl.airtable.com', 'res.cloudinary.com'],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
];

This should resolve the issue and we should be able to see the image thumbnails in the Strapi media library.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.