Unable to get large POST data in post handler nginx module

Maxim Dounin mdounin at mdounin.ru
Mon Mar 31 12:38:11 UTC 2014


Hello!

On Sun, Mar 30, 2014 at 10:53:33AM +0200, Mapper Uno wrote:

> Hi,
> 
> I am writing an nginx module that processes POST requests. For small
> data typically less than 1000 bytes, the module successfully receives
> data. However, for larger data > 1000 bytes or so, I get NULL.
> 
>     ngx_http_request_t *r;
>     ngx_chain_t *ch = r->request_body->bufs;
> 
>     // ----> For larger data ch->buf->pos is NULL
>     //
>     u_char *incoming_data = ch->buf->pos;
> 
> Any help would be highly appreciated

If a response isn't small enough for client_body_buffer_size, it's 
saved into a file, and buffers in r->request_body->bufs will 
be file-backed buffers.

See http://nginx.org/r/client_body_buffer_size for a user-level 
documentation.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list