Skip to content

increased nginx buffer to avoid 400 error from too large a request he…#41

Merged
theoht merged 2 commits into
mainfrom
fix/increase-nginx-buffer
May 18, 2026
Merged

increased nginx buffer to avoid 400 error from too large a request he…#41
theoht merged 2 commits into
mainfrom
fix/increase-nginx-buffer

Conversation

@theoht

@theoht theoht commented May 18, 2026

Copy link
Copy Markdown
Collaborator

…ader. Other work to do here to trim header down


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

…ader. Other work to do here to trim header down

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Nginx configuration in prod/nginx.conf by increasing the client_header_buffer_size and large_client_header_buffers to accommodate larger request headers. Feedback suggests reducing the client_header_buffer_size to 4k to minimize memory consumption per connection while still allowing larger headers via the large_client_header_buffers directive.

Comment thread prod/nginx.conf Outdated
}

http {
client_header_buffer_size 16k;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Setting client_header_buffer_size to 16k allocates this amount of memory for every connection, which can lead to high memory consumption under load. It is more efficient to keep this value small (e.g., 1k or 4k) and rely on large_client_header_buffers to handle larger headers only when necessary. This ensures that standard requests don't consume unnecessary memory while still resolving the 400 errors for larger requests.

  client_header_buffer_size   4k;

@theoht theoht merged commit 146dd98 into main May 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant