Nginx reverse proxy error 413 on large file uploads


#1

Hi,

Set up a Nextcloud session at our office to start and get away from Google. Unfortunately we don’t have public ip addresses and the one from the ISP is dynamic so we decided to use Nginx reverse proxy servers installed on Digital Ocean and just tunnel out the necessary ports we need access to. Attached a very quick and simple drawing of how this works:

Everything works great, the only problem we discovered recently is large file uploads. It seems that this is not a shortcoming I can’t get around and keep getting error 413.

For the record on the LAN Nextcloud is running with Apache, no issue whatsoever, only when I use through the proxies.

My Apache conf: https://pastebin.com/5G07iua5

No issues are appearing in the access or error logs, only the browser reports error 413.
Any help or guidance would be much appreciated!

P.S: Will add the rest of the configs, can’t post more than 2 links… And Yes I did research, spent 3 days on this already, can’t seem to figure it out. My last reference is from here: https://www.c-rieger.de/nextcloud-installation-guide/#c01


#2

The rest of the configs:

My Nextcloud.conf: https://pastebin.com/cJbdFRxR
My optimize.conf: https://pastebin.com/LR01eJ15


#3

My Nginx.conf: https://pastebin.com/ffgEFxNT


#4

Somebody? Anybody?
Anyhow, I will continue pursuing this issue tomorrow morning, will follow up on thos topic here.

In case you have any suggestions please feel free to share ::slight_smile:


#5

Ok… so a looooong time gone, had to move the office, holidays etc. but figured quite a while ago and updated the above posted config files from pastebin accordingly.

As the nginx manual suggests the context of the client_max_body_size module is http, server, location and I originally had it only in the main nginx.conf. So yea, jokes on me. Hope this can help someone in the future.