0

I am having troubles deploying a Strapi App on Railways. I installed Cloudinary to handle my images but some picture can’t be uploaded and when the failure happens the whole server break and I have to restart it.

The same image can be uploaded on Cloudinary directly but when I do it from the Strapi's admin panel I get this: enter image description here

I get an error 503 and this as the response: enter image description here

Here is my plugins.js:

module.exports = ({ env }) => ({
'users-permissions': {
  config: {
  jwtSecret: env('JWT_SECRET'),
  },
},
upload: {
  config: {
    provider: 'cloudinary',
    providerOptions: {
      cloud_name: env('CLOUDINARY_NAME'),
      api_key: env('CLOUDINARY_KEY'),
      api_secret: env('CLOUDINARY_SECRET'),
    },
    actionOptions: {
      upload:{},
      delete: {},
    },
  },
},

});

and my midlleware.js:

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

I've also tried whitout changing those files like in this guide: https://dev.to/candidosales/deploying-strapi-4-to-railway-589b.

VincentAb
  • 31
  • 8

0 Answers0