Skip to content

Fix: limit the in-memory API request body buffer - #473

Merged
SandObserver merged 1 commit into
mainfrom
fix/nginx-body-buffer
Oct 17, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/nginx-body-buffer

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Lower client_body_buffer_size on the /api/ location from 3m to 256k. nginx reads a whole request body before proxying, so a 3 MB in-memory buffer per request let slow unauthenticated uploads exhaust the container's 384 MB memory limit.
  • 256k still holds a settings save in memory, so normal saves stay out of nginx temporary files.
  • Replace the nginx config test with lower and upper bounds on the buffer.

Testing
All green, e2e included. The nginx config test now bounds the buffer between 128k and 512k.

Changelog

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.

@SandObserver SandObserver added the security Security fix label Oct 17, 2026
@SandObserver
SandObserver merged commit f30bdba into main Oct 17, 2026
6 checks passed
@SandObserver
SandObserver deleted the fix/nginx-body-buffer branch October 17, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant