fix(nginx): fastcgi_request_buffering must be on#13598
Merged
Conversation
* resolves: #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 php/php-src#7509 Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Contributor
Author
|
/backport to stable31 |
Contributor
Author
|
/backport to stable32 |
Contributor
Author
|
/backport to stable30 |
miaulalala
approved these changes
Sep 4, 2025
st3iny
approved these changes
Sep 4, 2025
Member
st3iny
left a comment
There was a problem hiding this comment.
Looks good but will also cause file uploads to be buffered to disk temporarily by Nginx.
Contributor
Author
We already do this for Apache so same behavior here. |
This was referenced Sep 4, 2025
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
☑️ Resolves
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 php/php-src#7509