Upload 502 bad gateway

Hello everyone, I’m using nginx as a reverse proxy and everything is working except file upload, it’s working fine on my computer, but on digital ocean it keeps giving me 502 bad gateway.
error.log =>
2019/09/25 19:52:49 [error] 1503#1503: *43 upstream prematurely closed connection while reading response header from upstream, client:, server: api.sherlockinhome.com, request: “POST /picture/upload HTTP/1.1”, upstream: "

I tried searching solutions for nginx but nothing worked, maybe it’s realted to nodejs or adonisjs?