Accessing request body in log phase

Maxim Dounin mdounin at mdounin.ru
Fri Jun 28 08:46:16 UTC 2013


Hello!

On Fri, Jun 28, 2013 at 01:25:20PM +0530, Pranay Kanwar wrote:

> Hi,
> 
> What is the correct way to get request body in a log phase handler module ?
> 
> The usual method of ngx_http_read_client_request_body via a handler doesn't
> work,
> the r->request_body->bufs is always NULL.
> 
> The handler works fine in other phases (for example the pre access phase).

At the log phase it's already too late to read body - it's either 
read or discarded by previous code (and the connection might be 
already closed).

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx-devel mailing list