Set client_max_body_size for /cool to avoid 413 on large documents - #139
Open
ajoe wants to merge 1 commit into
Open
Set client_max_body_size for /cool to avoid 413 on large documents#139ajoe wants to merge 1 commit into
ajoe wants to merge 1 commit into
Conversation
Without an explicit client_max_body_size, nginx's 1M default applies to the /cool endpoints. Any document larger than 1 MB sent to /cool/convert-to (used e.g. by Nextcloud richdocuments for office file previews) or uploaded during editing is rejected by nginx with "413 Request Entity Too Large" before it ever reaches coolwsd. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ajoe
force-pushed
the
fix-client-max-body-size
branch
from
July 10, 2026 07:36
e2b4582 to
74058d6
Compare
Contributor
|
!testme |
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.
Problem
The nginx config doesn't set
client_max_body_size, so nginx's default of 1M applies to the/coolendpoints. Any document larger than 1 MB that is POSTed to/cool/convert-to/...— which Nextcloud's richdocuments app uses to generate office file previews — is rejected by nginx with413 Request Entity Too Largebefore it ever reaches coolwsd. The same limit applies to image/file uploads during editing.On my instance this produced dozens of these entries in the Nextcloud log:
Fix
Set
client_max_body_size 100M;in thelocation ~ ^/(c|l)oolblock (the "download, presentation and image upload" endpoint). 100M matches what other Collabora reverse-proxy setups commonly use and is far above typical document sizes while still bounded.Test
Verified on a YunoHost instance (Collabora 25.04.10.3, Nextcloud 34): before the change,
curl -F "data=@file.docx" https://<domain>/cool/convert-to/pdffails with 413 for files > 1 MB; after adding the directive and reloading nginx, the conversion succeeds and Nextcloud office previews are generated again.🤖 Generated with Claude Code