aboutsummaryrefslogtreecommitdiffstats
path: root/.htaccess
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2024-01-23 11:01:58 +0100
committerSimon L <szaimen@e.mail.de>2024-02-01 15:55:39 +0100
commit2367b57593b3158bd2e8bb731387d9372cd9fc10 (patch)
treeecdfe9ee868c75406cdc324fad9744587c41f697 /.htaccess
parent2b17710ce5ef6084683f9c44d80fa921b08cdc54 (diff)
downloadnextcloud-server-2367b57593b3158bd2e8bb731387d9372cd9fc10.tar.gz
nextcloud-server-2367b57593b3158bd2e8bb731387d9372cd9fc10.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