413 - File is too large - iPhone 14 Pro Max

What do I need to change on my nextcloud server (I host it on a proxmox turnkey LXC container)?

I keep getting a 413 File too large on my iPhone 14 Pro Max and it will not upload my 4K videos using the NextCloud app on iOS on my iPhone 14 Pro Max

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html

If you get stuck after checking out the chapter in the manual for that issue @tflidd shared, you’ll have to share more info about your installation method and topology.

thank you. I will report back.

413 the file is too large

Situation: I run my own NextCloud. It works great till now. Uploading photos is not a problem. 4K Videos = 413 File too Big Error. This occurs on my iPhone app iOS app.

Data: I am running NextCloud on a LXC Container in Proxmox on a Dell R710 server.
Domain Name → CloudFlare → Internet → Modem → pfSense Firewall (bare metal box) running HAProxy / Let’s Encrypt → MikroTik (VLANs) → Dell R710 (Proxmox) → LXC Container (NextCloud) → OpenMediaVault (hard drive dedicated to my nextcloud account) Hard Drive is 3TB 7200 RPM 3.5"

Things I checked:
Cloudflare - I tripled made sure it is running in DNS only mode to avoid any limitations on upload.

HAProxy - I am researching to see if there are any upload limits, so far I can find none.

Problem
-507 storage quota is reached

Checks
-OpenMediaVault logs show no errors
-NextCloud shows no limits on quota it is set to unlimited
-Looking like a PHP limitation
-Research shows it could be a memory_limit. Check

Solution 1
-WinSCP => /etc/php/7.3/apache2/php.ini
-Right Click / Edit with NotePad++

Original
memory_limit =512M

Change to
memory_limit =2000M

Result
-Failed

Solution 2
-Proxmox - change RAM of container from 1GB to 3815
-Swap MiB = 1908
-Resized the hard drive of the container to 12GB

Result
-Failed but I think it will help

Solution 3 - Change php.ini
located in /etc/php/7.3/apache2/php.ini
-Original
upload_max_filesize =8M
-Change to
upload_max_filesize =2000M

Original
post_max_size =16M
Change to
post_max_size =2000M

Try
post_max_size =0

Result = Failed

Solution 4
Original
max_input_time = 60
Change to
max_input_time = -1

Original
max_execution_time = 30
Change to
max_execution_time = 3600

Original
post_max_size =16M
Change to
post_max_size =0

Original
max_input_time = 60
Change to
max_input_time = -1

Results = Failed

Solution 4

I created a temp folder for big files

upload_tmp_dir = /var/big_temp_file/
enable in php.ini
find “upload_tmp_dir”
use WinSCP to create directory
create folder in /var
call it /var/next_temp/
= upload_tmp_dir = /var/next_temp/
Set permissions to 0755


Solution 5

I also made all the changes to
php.ini located in /etc/php/7.3/cli
example
max_execution_time = 3600
max_input_time = -1
memory_limit =2000M
upload_tmp_dir = /var/next_temp/
upload_max_filesize =2000M

Results = failed

Solution 6

The LXC container did not have suod commands
I had to install sudo. Putty in and do the following:

install sudo
do the following

apt update -y
apt install sudo -y

Solution 7

Putty & log in
Switch to directory /var/www/nextcloud/

sudo -u www-data php occ config:app:set files max_chunk_size --value 20971520

Results: Failed
I then tried

sudo -u www-data php occ config:app:set files max_chunk_size --value 0

reboot server and try again on iPhone 14 Pro Max
Results: Failed

Solution 8
Add the following lines to
/var/www/nextcloud/.user.ini
Putty log in. switch to directory
nano the file above add the following lines
save and exit and reboot

php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value max_input_time 3600
php_value max_execution_time 3600

Results: Failed

Solution 9

WinSCP switch to directory /etc/apache2/apache2.conf
open in Notepad+ +
Scroll to the bottom / end
Add line
LimitRequestBody 0

exit/save/close/reboot server

Results = SUCCESS
works I can upload files from my iPhone 14 Pro Max 4K videos
using the nextcloud app on iOS
tested on a 2.5 GB file and a 4.45 GB files that are 4K videos
Tested it on Wifi not yet on 5G

Final thoughts: even though solution 9 works. I believe it is a culmination of all the solutions that makes this work now.
I tried playing with the following
Uploading while chunk size was set to value 20971520 seems to fail
Uploading while chunk size was set to value 0 seems to work
Use 0

Also because I am filming in 4K a lot
in the iPhone NextCloud iOS app
I went into More → Settings → Auto upload → Auto upload videos → Enable → Both
-Auto upload videos
-Only use Wi-Fi connections
-Autolock → set to Never
-Upload videos

Also helps to check the log files in the admin account for future errors
Login to Admin account → Settings → Left Side Scroll to “Logging”