Problems with large downloads in Nextcloud - change temp folder

Hello everyone,

I am running OMV (latest version) on a Xeon 64bit, with three HDDs and one 128 GB SSD attached.

The SSD is divided into 32GB for the system partition (which is approximately half used) and 72GB as a (mostly unused) secondary partition, the remaining is space is unallocated for over-provisioning.

On the same system, I run Nextcloud in a Docker container, together with swag/nginx, also in a container.

Until now, I had the problem that I could not download files larger than 2GB from my Nextcloud.

After a lot of messing around in the PHP settings and whatnot, I found out that this problem was due to a wrong setting in /.../nginx/proxy-confs/nextcloud.subdomain.conf.

After I changed proxy_max_temp_file_size there from 2048M to 16384M (16G does not work), I can download files up to 16GB.

But now another problem occurred: For each download, nginx creates a temp file with the size of the download on the system partition. Due to only having a little more than 16GB free in the system partition, my download size is now limited to 16GB, even though I have some files that are larger that I would also be able to download.

The obvious solution would be to resize the partitions, but IMHO this solution is not very elegant for two reasons:

  1. I think it would be better to have the temp folder on the other partition, so the system partition stays mostly untouched.

  2. To run GParted Live, I would need to move the whole system out of my closet, as right now it is running headless, and there is no monitor nearby.

So I would like to change the temp folder for nginx to the second SSD partition. But how do I do that? I know that I need to add client_body_temp_path in of the nginx.conf files, but which one? I have:


And do I need to change permissions/ownership? I tried to change the /etc/nginx/nginx.conf, but after that, I can’t access my Nextcloud.

I have mounted /srv/dev-disk-by-uuid-xxxx-xxxx/tmp and want to use this a temp folder.