Upload failing with 502 Bad Gateway

Facing an issue while uploading images. Trying to upload a .wep image. Upload fails with 502 Bad Gateway. The service stops with OutOfMemoryError: Container killed due to memory usage. This image of 534KB, however, images of sizes 15MB gets upload.

Image link

Checked the following:

  • images with .jpg, .png of sizes upto 15MB gets uploaded
  • other images with .webp with sizes upto 2.1MB gets uploaded

Upload plugin: strapi-provider-upload-aws-s3-plus-cdn
Strapi version: 4.15.5

Only this particular image fails to upload. Tried switching on/off Responsive friendly upload and Size optimization, nothing changed. Tried changing the name, nothing changed.