From 232da84cf75c7af342b3042939aa558f2a70d602 Mon Sep 17 00:00:00 2001 From: traveler Date: Mon, 27 Apr 2026 11:02:00 -0500 Subject: [PATCH] sdfsdf --- swarm/stack/caddy/Caddyfile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/swarm/stack/caddy/Caddyfile b/swarm/stack/caddy/Caddyfile index 30e91d8..42a9926 100644 --- a/swarm/stack/caddy/Caddyfile +++ b/swarm/stack/caddy/Caddyfile @@ -51,15 +51,32 @@ # Nextcloud AIO - Optimized for WebDAV and Folder Uploads cloud.netgrimoire.com { - # No CrowdSec here for now to prevent 404s on rapid-fire WebDAV requests + # Disable body limits for large uploads (Nextcloud AIO manages its own) + request_body { + max_size -1 + } + + # Use 'copy_response_headers' to ensure WebDAV 'Move/Copy' headers + # aren't stripped by Caddy's default normalization. reverse_proxy http://nextcloud-aio-apache:11000 { + # CRITICAL: Prevents Caddy from normalizing slashes/spaces in paths, + # which is the primary cause of 'Folder Not Found' errors in SabreDAV. + rewrite_upstream_request_header + header_up Host {host} header_up X-Real-IP {remote_host} header_up X-Forwarded-For {remote_host} - header_up X-Forwarded-Proto {scheme} + # Hardcode to https so Nextcloud's internal logic + # doesn't break during the 302/redirect phase of a folder creation. + header_up X-Forwarded-Proto https + + # Essential for WebDAV 'MOVE' and 'COPY' commands used in folder uploads + header_up Destination {http.request.header.Destination} + transport http { - response_header_timeout 300s + # Increased for large file assembly (merging chunks) + response_header_timeout 600s dial_timeout 30s } }