Upload fails with unkown error

Hello,
I run a private instance of Nextlcoud since two years now. In the past I was mostly using it alone and syncing files using NC client.
But we now heavily rely on the web interface to share photos between friends. we are facing issues during upload:

  • sometimes it fails with “Unknown error” message
  • sometimes it hangs
  • sometimes it uploads only a few of the files
  • I can see Bad request “expected file size differs …” in logs in the admin panel
  • It seems to affect more seriously mobile devices

The installation is the following:

  • OS: Debian 12
  • Nextcloud 29.0.6 running in podman (alpine image version)
  • PostgreSQL 16.1 running in podman (alpine image version)
  • Caddy web server running in podman (reverse proxy)

I use the default configuration of php-fpm for Nextcloud (no tweaks done for big-files)

Here is the relevant Caddyfile section:

cloud.{$DOMAIN} {
	encode gzip zstd

	# Collabora
	route /browser/* {
		reverse_proxy nextcloud-collabora:9980
	}
	route /hosting/* {
		reverse_proxy nextcloud-collabora:9980
	}
	route /cool/* {
		reverse_proxy nextcloud-collabora:9980
	}

	# Nextcloud
	route {
		redir /.well-known/carddav /remote.php/dav 301
		redir /.well-known/caldav /remote.php/dav 301
		header Strict-Transport-Security max-age=31536000;

		@forbidden {
			path /.htaccess
			path /data/*
			path /config/*
			path /db_structure
			path /.xml
			path /README
			path /3rdparty/*
			path /lib/*
			path /templates/*
			path /occ
			path /console.php
		}
		respond @forbidden 404

		root * /var/www/html
		php_fastcgi nextcloud:9000
		file_server
	}
}

Have you an idea to solve the issue?