aboutsummaryrefslogtreecommitdiffstats
path: root/.htaccess
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-01-23 11:01:58 +0100
committerLouis Chemineau <louis@chmn.me>2024-01-24 12:11:37 +0100
commit3c0c373083a74a14e62664edd62b7052d3717080 (patch)
treeb1c1be5b671b961705c93a1e918fbf40866f07cf /.htaccess
parent7f1b980dcfd55ef9e277865cebd6879f69e3e43a (diff)
downloadnextcloud-server-3c0c373083a74a14e62664edd62b7052d3717080.tar.gz
nextcloud-server-3c0c373083a74a14e62664edd62b7052d3717080.zip
Buffer chunked requests
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to '.htaccess')
-rw-r--r--.htaccess14
1 files changed, 14 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess
index ece21e1450d..102b11236be 100644
--- a/.htaccess
+++ b/.htaccess
@@ -94,5 +94,19 @@
RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
+# Clients like xDavv5 on Android, or Cyberduck, use chunked requests.
+# When FastCGI or FPM is used with apache, requests arrive to Nextcloud without any content.
+# This leads to the creation of empty files.
+# The following directive will force the problematic requests to be buffered before being forwarded to Nextcloud.
+# This way, the "Transfer-Encoding" header is removed, the "Content-Length" header is set, and the request content is proxied to Nextcloud.
+# Here are more information about the issue:
+# - https://docs.cyberduck.io/mountainduck/issues/fastcgi/
+# - https://docs.nextcloud.com/server/latest/admin_manual/issues/general_troubleshooting.html#troubleshooting-webdav
+<IfModule setenvif.c>
+ <Location "/remote.php">
+ SetEnvIf Transfer-Encoding "chunked" proxy-sendcl=1
+ </Location>
+</IfModule>
+
AddDefaultCharset utf-8
Options -Indexes