Files not getting synced (413 Request Entity Too Large)

Nextcloud version: 15
Operating system and version: docker image linuxserver/nextcloud
Apache or nginx version: nginx 1.14.2
PHP version: 7.2.13

The issue:

Some files are not getting synced and the Windows client gives me the error

"Server replied "413 Request Entity Too Large" to "PUT https://my_domain/remote.php/dav/uploads/username/XXXXXXXX/YYYYYY" (skipped due to earlier error, trying again in 6 hour(s))

My nextcloud is behind a letsencrypt nginx reverse proxy. I checked there and modified the file size limits in proxy.conf file:

client_max_body_size 10G;
client_body_buffer_size 400M;

After doing this I restarted the letsencrypt container and restarted the sync, which now passed almost all the files. Alas, there are some files left (some bmp, pdf, rar, zip and doc) which are not really too big - 20M, 11M, 15M.

At the same time, If I copy a new file (I tried with a zip file) pretty large (160M) I have no problem getting it synchronized on the server.

So, is there a “flag” set on these files so that they would not sync?

I am having the same problem. Any body have any ideas?

i have the same problem! With mobile device.

If you’ve already tried the usual fixes of changing client_max_body_size in the nginx.conf, as well as the post_max_size and upload_max_filesize in php.ini, and it still doesn’t work. Please see the solution that I posted here:

1 Like

Where is the file proxy.conf, i have me too an container Letsencrypt/PROXY; Nextcloud;

Hello, i don’t found the file, where is this file ?
i do this :slight_smile:
"You can also enter the container by typing docker exec -it letsencrypt bash and then edit /config/nginx/proxy.conf ".
But not file in my container LetsEncrypt.
please, regards,

What can you see, if you enter the container and use the command ls -lah /config/nginx/?

this my result :root@NAS01:~# docker exec -it nginx-letsencrypt bash
bash-5.1# ls -lah /config/nginx/
ls: cannot access ‘/config/nginx/’: No such file or directory

Ok, that explains the missing file. You could use the following command in your docker container to see, if there is a file named proxy.conf at all

find / -type f -name "proxy.conf"

Or you could locate any file which has .conf as an ending and see, if any of those point towards nginx

find / -type f -name "*.conf"

bash-5.1# find / -type f -name “proxy.conf”
bash-5.1# find / -type f -name “*.conf”

Hmm, the most likely file for me, would be the /etc/nginx/conf.d/default.conf one, since there is no proxy.conf

Please could you tell me/us, what guide or what docker repository you were using, to install your Nextcloud Docker?

i found my issue, on my container nginx-web, the file is /etc/nginx/nginx.conf and i set client_max_body_… in this file, and now it works fine.
thanks for all

1 Like

I’m plagued with the same issue. My Nextcloud Linux dekstop client retries uploading a single 888MB big file again and again and always fails with the error:

Path/of/big-file: Server replied "413 Request Entity Too Large" to "PUT https://my-nextloud-url/remote.php/dav/uploads/my-user/4116002158/0000000000001

My Nextcloud server is running without any docker / virtualization on a Debian Nginx server with php-7.4-fpm setup as instructed by some nextcloud guides.

I’ve adopted my /etc/nginx/nginx.conf to have

client_max_body_size 10G;
client_body_buffer_size 400M;

set to those values.

I’ve added a info.php file (containing phpinfo()) to the www/html folder to tell me that the php.ini file used is /etc/php/7.4/fpm/php.ini - And adapted the values of post_max_size and upload_max_filesize in it.

I’ve tried restarting the nginx and php7.4-fpm services afterwards, but the problem still persists. Strangely, my Android Nextcloud clients has no problem uploading far bigger files than that, which get downloaded to my Linux desktop just fine.

UPDATE: Ah, I just found there is a feature called “Chunked file upload” that seems to have been implemented in the Android app, but not in the Linux desktop client.

UPDATE2: with
grep -ri client_max_body_size /etc/nginx/
I found that the site specific config file in /etc/nginx/sites-available/ still contained a smaller value for client_max_body_size - adapted that to something large enough and restarted nginx again - now the error is gone, nice one! :slight_smile:

1 Like

I’m having the same issue and tried all of suggested fix.
I changed nginx.conf, php.ini, config.php still not wanting to upload any files bigger than 1G

SOLUTION for me:
Added the recommended configuration in nginx and php.
Restarting Nextcloud-Client did NOT help. Completely removed account vom Nextcloud client and adding account again. After that it works!

(I have a bit different configuration: NAT > nginx (reverse proxy) > apache with nextcloud running on it.)

1 Like

Below worked for me:

  • Platform: nextcloud on proxmox
  • file locaiton: /etc/nginx/nginx.conf
  • Open above file using nano editor.
  • change the line client_max_body_size 1M; to client_max_body_size 100M;
  • save file and exit
  • restart nginx server using command: service nginx restart

Thank you for posting this solution, it should be pinned, this one worked for me too

Had same kind of problem here.

Here is the context:

  • Docker image of Nextcloud (, running on nginx).
  • Docker image of nginx-proxy-manager.
  • Using PhotoSync app from my Android device, that connects to Nextcloud through nginx-proxy-manager, using a WebDAV connection.

Here is what I had to do:

  • Add “client_max_body_size 0;” (without quotes) in the “advanced” tab from my proxy host in nginx-proxy-manager.
  • Replace “client_max_body_size 512M;” with “client_max_body_size 0;” in the following file: “[…]/nextcloud/nginx/site-confs/default.conf” in Nextcloud.
    (Related parameters in php.ini didn’t affect WebDAV connections)

Hope that helps someone!