From 48e8a82d87151a3e6b79f855ca2aafee61d32ebb Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 4 Sep 2025 12:23:17 +0200 Subject: [PATCH] fix(nginx): `fastcgi_request_buffering` must be `on` * resolves: https://github.com/nextcloud/documentation/issues/9574 Some clients like DAVx5 use chunked transfer encoding. PHP-FPM does not support this[1] because it requires to comply with the CGI standard - 20+ years old - which enforces a Content-Length header. So we need to buffer the whole request until passing it to PHP-FPM. Without this 0-byte files would be created on Nextcloud as PHP-FPM will not only set content-length to 0 but also does not pass the body data stream. [1] https://bugs.php.net/bug.php?id=51191 and https://github.com/php/php-src/pull/7509 Signed-off-by: Ferdinand Thiessen --- .../configuration_files/big_file_upload_configuration.rst | 6 ------ admin_manual/installation/nginx-root.conf.sample | 2 +- admin_manual/installation/nginx-subdir.conf.sample | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/admin_manual/configuration_files/big_file_upload_configuration.rst b/admin_manual/configuration_files/big_file_upload_configuration.rst index f83a15ba4..0c61a9ed9 100644 --- a/admin_manual/configuration_files/big_file_upload_configuration.rst +++ b/admin_manual/configuration_files/big_file_upload_configuration.rst @@ -92,12 +92,6 @@ nginx * `fastcgi_read_timeout `_ * `client_body_temp_path `_ -Since nginx 1.7.11 a new config option `fastcgi_request_buffering -`_ -is available. Setting this option to ``fastcgi_request_buffering off;`` in your nginx config -might help with timeouts during the upload. Furthermore it helps if you're running out of -disc space on the tmp partition of your system. - .. note:: Make sure that ``client_body_temp_path`` points to a partition with adequate space for your upload file size, and on the same partition as the ``upload_tmp_dir`` or ``tempdirectory`` (see below). For optimal diff --git a/admin_manual/installation/nginx-root.conf.sample b/admin_manual/installation/nginx-root.conf.sample index 3ae568a3b..6c7a6c281 100644 --- a/admin_manual/installation/nginx-root.conf.sample +++ b/admin_manual/installation/nginx-root.conf.sample @@ -159,7 +159,7 @@ server { fastcgi_pass php-handler; fastcgi_intercept_errors on; - fastcgi_request_buffering off; + fastcgi_request_buffering on; # Required as PHP-FPM does not support chunked transfer encoding and requires a valid ContentLength header. fastcgi_max_temp_file_size 0; } diff --git a/admin_manual/installation/nginx-subdir.conf.sample b/admin_manual/installation/nginx-subdir.conf.sample index 3b731ff0e..c1b63cc57 100644 --- a/admin_manual/installation/nginx-subdir.conf.sample +++ b/admin_manual/installation/nginx-subdir.conf.sample @@ -158,7 +158,7 @@ server { fastcgi_pass php-handler; fastcgi_intercept_errors on; - fastcgi_request_buffering off; + fastcgi_request_buffering on; # Required as PHP-FPM does not support chunked transfer encoding and requires a valid ContentLength header. fastcgi_max_temp_file_size 0; }