Regarding HTTP chunked Body being stored in temp_file

Devashi Tandon devashi.tandon at
Fri Sep 16 07:31:08 UTC 2022


In our module code, we are processing the HTTP request body when it is not stored in r->request_body->temp_file.

When I send a 9381 bytes body, NGINX doesn't store the body in temp_file but in the internal buffers. Hence we are able to process the body.

However, when I enable chunked encoding, the same 9381 bytes body, gets stored in the r->request_body->temp_file.

To avoid getting stored in temp_file, I have to increase the client_body_buffer_size to a larger value than the default. In that case, chunked encoded http body is NOT stored in temp_file and we are able to process it.

Is there any reason why the behaviour of client_body_buffer_size is different in case of regular HTTP traffic v/s chunked encoded HTTP traffic? Why do we need a larger buffer size to ensure chunked encoded traffic doesn't get stored in temp_file?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list