I recently configured my Nextcloud DNS records on Cloudflare to use the Cloudflare proxy. Mostly because I wanted to use the Bot Protection feature and other WAF services. So that I can sync my files in peace.
However, I started receiving 413 errors on file uploads.
Apparently the 413 Request Entity Too Large error is caused by Cloudflare’s proxy.
Solution
Assuming that your Nextcloud instance (and other reverse proxy) is configured to handle large file uploads, the Cloudflare proxy is the one blocking the request. Because it despises large files (above 100MB).
To fix this, you need to configure the Desktop Client to chunk the file uploads.
-
Locate the
nextcloud.cfg
file.- Linux:
~/.config/nextcloud/nextcloud.cfg
- Windows:
%APPDATA%\nextcloud\nextcloud.cfg
- macOS:
~/Library/Preferences/Nextcloud/nextcloud.cfg
- Linux:
-
Open the file in a text editor and add the following line (100000000 bytes = 100MB):
maxChunkSize=100000000
-
Restart the Desktop Client.
-
Upload your files with ease.