Stack Matrix Hub (11)
Tuning WebDAV Chunked Uploads Behind Caddy & NGINX
Eliminate 413 Request Entity Too Large and 504 timeouts on 16-32 GB studio video and CAD sync uploads.
APACHE_PORT=11000 · 10 MB WebDAV chunks · Buffering OFF
Preventing Reverse Proxy Disk Buffering on 16 GB Files
Nextcloud desktop clients split large files into 10 MB WebDAV chunks and reassemble them inside the Apache container. If NGINX enables proxy_request_buffering on, large parallel uploads fill /var/cache/nginx and trigger 504 Gateway Timeouts.
Matching NEXTCLOUD_UPLOAD_LIMIT & php-custom.ini
Set client_max_body_size 0 and proxy_request_buffering off in NGINX (Caddy disables request buffering automatically), while aligning NEXTCLOUD_UPLOAD_LIMIT=16G and NEXTCLOUD_MAX_TIME=3600 in docker-compose.yml.
Measured Thresholds & Configuration
| Proxy Setting | NGINX Value | Caddy Value | Purpose |
|---|---|---|---|
| Max Body Size | client_max_body_size 0 | Default unlimited | Allow 16-32 GB streams |
| Request Buffering | proxy_request_buffering off | Native streaming | Prevent proxy disk exhaustion |
| Read Timeout | proxy_read_timeout 3600s | Default long stream | Allow chunk assembly |