413 HTTP error for Nextcloud installation

Some years back I had a selfhosted Nextcloud instance running on a Raspberry Pi. At some point I decided that managing it and keeping it up to date was too much of a hastle, so I moved to a managed instance. That worked very well for some years now – the only real limitation was the amount of storage available.

I’ve hosted quite a number of other services since then, all based on docker containers. Long story short: I decided to give it a try again. The basic setup was easy enough, but there were quite some configurations that I had to figure out.

The most pertinent one being a 413 HTTP error when syncing larger files (>512MB). Now on the first look, the solution seems easy: Nginx – the web server being used by the linuxserver/nextcloud docker image – needs to be configured to allow larger request bodies. But! I also use a reverse proxy to make my services available to on the internet – this is also an Nginx instance. So there was another configuration to think of. Anyway, having disabled request body limits ( client_max_body_size=0 ) both on the reverse proxy’s configuration and on the main Nginx configuration inside the Nextcloud docker container, I still got the same error. After some digging, In the end, I discovered that the main nginx.conf file in the Nextcloud container includes further configuration files (/config/nginx/site-confs/) and the default.conf overwrote my configuration in the main nginx.conf. Maybe, this post helps someone to find their way around in a similar situation.

Leave a Reply

Your email address will not be published. Required fields are marked *