Skip to content

feat(nginx): lower client_max_body_size - #861

Merged
wrenix merged 2 commits into
nextcloud:mainfrom
RisingOpsNinja:nginx_decrease_client_max_body_size
Jun 4, 2026
Merged

feat(nginx): lower client_max_body_size#861
wrenix merged 2 commits into
nextcloud:mainfrom
RisingOpsNinja:nginx_decrease_client_max_body_size

Conversation

@RisingOpsNinja

Copy link
Copy Markdown
Contributor

Description of the change

This change lowers the Nginx configuration client_max_body_size to match the default PHP_UPLOAD_LIMIT of 512 MiB in the php-fpm docker image and also match the default nginx configuration in the Nextcloud admin manual after enabling fastcgi_request_buffering #855

Benefits

Lowering the configuration will reduces memory, disk pressure and also lowers risk of resource exhaustion.

client_max_body_size is set to 10 GiB which is an exceptionally large default value.

Possible drawbacks

Some clients may not support chunked uploads and send the whole file in a single request. Nginx will reject the request if it is larger then client_max_boy_size.

Checklist

Signed-off-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com>
Signed-off-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com>
@wrenix

wrenix commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

thanks for keep that in mind

@wrenix
wrenix enabled auto-merge (squash) June 4, 2026 20:53
@wrenix
wrenix merged commit 8885610 into nextcloud:main Jun 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants