Unable to upload images as assets using Strapi Content Manager

Node version: 18.19.0
I am using this on server via nginx. I am able to upload documents and videos but for the images I see the following error:

On server I see a strange logs of error: munmap_chunk(): invalid pointer

However, on the nginx logs I see the error:

2024/03/04 14:44:41 [crit] 2734719#2734719: *7108 SSL_read() failed (SSL: error:0A000126:SSL routines::unexpected eof while reading) while keepalive, client: “xxxxx”, server: 0.0.0.0:443
2024/03/04 14:45:05 [error] 2734719#2734719: *7114 upstream prematurely closed connection while reading response header from upstream, client: “xxxxx”, server:“xxxxx”, request: “POST /upload HTTP/1.1”, upstream: “http://127.0.0.1:1337/upload”, host: “xxxxx”

I haven’t found this error on any forum. Please provide what went wrong.

I am also currently struggling with this exact same issue.
First it seemed like it crashed on too big of dimensions.
But now it just crashes on any upload