From bb8d9a15c28bf5f7db9b5e02ea639bb3427c0ca8 Mon Sep 17 00:00:00 2001 From: Arpad Krejczinger Date: Tue, 19 Aug 2025 22:05:12 +0200 Subject: [PATCH] Update WebDAV troubleshooting guide with URL encoding fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add section on URL encoding issues causing HTTP 400 errors - Document nginx proxy_pass solution for preserving request URI - Update final working configuration with HTTP/1.1 fixes - Include Connection header and proxy_http_version settings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/troubleshooting/webdav-copyparty.md | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting/webdav-copyparty.md b/docs/troubleshooting/webdav-copyparty.md index e1dcab4..7dd4969 100644 --- a/docs/troubleshooting/webdav-copyparty.md +++ b/docs/troubleshooting/webdav-copyparty.md @@ -39,6 +39,27 @@ server { - Error: `HTTP/1.1 403 Forbidden` **Solution**: Add `d` (delete) permission to user accounts: + +### 3. URL Encoding Issues +**Problem**: Files/folders with spaces or special characters in names caused HTTP 400 errors. + +**Symptoms**: +- Files without spaces upload successfully +- Files with spaces in path fail: `HTTP/1.1 400 Bad Request` +- Logs show "bad headers" errors from copyparty +- URLs like `/files/folder/file%20name.txt` fail + +**Solution**: Pass original request URI to preserve URL encoding: +```nginx +location ~ ^/files(/.*)?$ { + # Pass original request URI to preserve URL encoding + proxy_pass http://127.0.0.1:8082; + # ... other proxy settings +} +``` + +Instead of `proxy_pass http://127.0.0.1:8082/files$1;` which manipulates the path. + ```ini [/shared] /home/hoborg/shared @@ -115,7 +136,8 @@ server { # Explicitly allow WebDAV methods limit_except GET POST PUT DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK { deny all; } - proxy_pass http://127.0.0.1:8082/files$1; + # Pass original request URI to preserve URL encoding + proxy_pass http://127.0.0.1:8082; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -140,6 +162,10 @@ server { # Critical: Streaming uploads for WebDAV proxy_buffering off; proxy_request_buffering off; + + # Critical: Use HTTP/1.1 and fix connection headers + proxy_http_version 1.1; + proxy_set_header Connection ""; # Critical: Disable nginx response modifications proxy_redirect off;