Cannot upload image after upgrading to Ghost 4.x

I running a Ghost instance with the official Ghost Alpine Image from some years and past week I made the update to Ghost 4.3.2 (to be more precise: I was on version 3.39.2, I made a backup, upgrade to latest 3.x.x available (3.42.5), then backup again, and upgrade to 4.3.2).

Everything seems working, but tonight I wanted to write a post, and when I add an image I get a 502 error. No error on docker logs ghost, no error in ghost log files, nginx give me this error:

2021/04/26 19:22:05 [warn] 22#22: *4 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 90.105.111.106, server: xxxxx, request: "POST /ghost/api/canary/admin/images/upload/ HTTP/2.0", host: "xxxxxx", referrer: "https://xxxxx/ghost/"
2021/04/26 19:22:09 [error] 22#22: *4 upstream prematurely closed connection while reading response header from upstream, client: 90.105.111.106, server: xxxxx, request: "POST /ghost/api/canary/admin/images/upload/ HTTP/2.0", upstream: "http://172.17.0.4:2368/ghost/api/canary/admin/images/upload/", host: "xxxxx", referrer: "https://xxxxxx/ghost/"
2021/04/26 19:22:39 [warn] 22#22: *4 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000002, client: 90.105.111.106, server: xxxxxx, request: "POST /ghost/api/canary/admin/images/upload/ HTTP/2.0", host: "xxxxxx", referrer: "https://xxxxxx/ghost/"

I tried to restart Ghost, restart Nginx (which is itself inside a Docker container), restart Docker. I tried to go back to version 3.42.5 and everything works well.

I saw on forum some error with node 14, sharp dependencies and too large file, but nothing seems to apply to my case.

  • Ghost Version: 4.3.2 (latest docker alpine image)
  • Node Version: v12.22.1
  • Browser/OS: Firefox/Linux
  • Database: SQLite3

My Nginx config, if it can help:

server {
listen 443 ssl;
server_name xxxxxx;

access_log /var/log/nginx/access.blog.log main;

include conf.d/letsencrypt.conf.include;

location / {
    proxy_pass              http://ghost:2368;
    proxy_set_header        X-Real-IP $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        X-Forwarded-Proto $scheme;
    proxy_set_header        Host $http_host;
    proxy_set_header        X-NginX-Proxy true;
    proxy_set_header        Connection "";
    proxy_read_timeout      90s;
    proxy_connect_timeout   30s;
    proxy_max_temp_file_size 50m;
    client_max_body_size    50m;

    proxy_http_version 1.1;
}

}