]> git.kaiwu.me - nginx.git/commit
Added client_body_early_read directive
authorRoman Arutyunyan <arut@nginx.com>
Wed, 8 Apr 2026 17:07:15 +0000 (21:07 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Fri, 21 Aug 2026 13:00:43 +0000 (17:00 +0400)
commit3f6f7824d4e2eb1ac37dec76683d525ac0ff521c
treee118bcfe10225d2e0e07813b6ecc90c96dc36b28
parentbc7c3424c30d3b140650cdc5ba7fe978f55f4f4e
Added client_body_early_read directive

The directive accepts predicates.  When enabled, request body is read
immediately after the headers and before choosing a location.
Body read settings from the server block are used in this case.

Example:

http {

    map $http_content_type $is_json {
        application/json 1;
    }

    server {
        listen 8000;

        client_body_early_read $is_json;
        client_max_body_size 256;
        client_body_buffer_size 256;

        return 200 $request_body;
    }
}
src/http/ngx_http_core_module.c
src/http/ngx_http_core_module.h
src/http/ngx_http_request.c