Skip to content

Clarified early reading of the request body - #324

Open
xeioex wants to merge 1 commit into
nginx:mainfrom
xeioex:early_read_refs
Open

Clarified early reading of the request body#324
xeioex wants to merge 1 commit into
nginx:mainfrom
xeioex:early_read_refs

Conversation

@xeioex

@xeioex xeioex commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

In continuation from discussion started in #321.

The client_body_early_read directive changes when and how the request body becomes available, but that is currently documented only on the directive itself. Related places still describe the pre-1.31.5 state or leave the interaction unstated:

  • $request_body claims the value is available only in locations processed by proxy_pass/fastcgi_pass/uwsgi_pass/scgi_pass; with early reading it is available in any
    location.
  • location: a predicate whose variable depends on the request body never matches unless the body is read early, since predicates are evaluated before the body is read. The failure is silent, the request falls back to the prefix location.
  • client_body_in_file_only: the fact that it is ignored is stated only in client_body_early_read, not in the directive itself.
  • client_body_early_read: it is not said that the body is read before a location is chosen, which is what makes the server-block settings, the ignored client_body_in_file_only and the availability in any location follow. The client_max_body_size/client_body_buffer_size pair in the example is unexplained: with a body larger than the buffer the body is written to a temporary file and $request_body is not set.

@xeioex
xeioex requested review from arut, pluknet and route443 September 4, 2026 00:31
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