Uploading large images

Hi, I have a problem to upload image larger then 3MB. Firstly, I thought it’s problem of Nginx configuration.

Nginx error log shows problem upstream:
2020/03/16 08:19:37 [error] 17903#17903: *631 upstream prematurely closed connection while reading response header from upstream, client:, server: slavkakratka.do.netvarec.cz, request: “POST /dashboard/records/13 HTTP/1.1”, upstream: “”, host: “slavkakratka.do.netvarec.cz”, referrer: “https://slavkakratka.do.netvarec.cz/dashboard/records/13/edit

Do you know, what to do with that?