$request_length outside of log module

Jonathan Matthews contact at jpluscplusm.com
Mon Jan 28 14:24:17 UTC 2013


On 28 January 2013 14:15, Richard Kearsley <rkearsley at blueyonder.co.uk> wrote:
> On 28/01/13 14:05, Jonathan Matthews wrote:
>> I would think you could get something equivalent and useful out of
>> $upstream_http_content_length, as per
>> http://wiki.nginx.org/HttpUpstreamModule#.24upstream_http_.24HEADER .
>> YMMV.
>
> Hi,
> It's not the same, $request_length is the length of what the client
> (browser) sent it's request for a file e.g. request headers, request body
> I suppose I could loop through the headers and body and count their
> lengths.. but not ideal

My bad - I misread your original email.

$request_length is actually defined here
(http://wiki.nginx.org/HttpLogModule#log_format) as the request
/body/'s length, i.e. not counting headers. You might get something
useful out of $http_content_length instead.

Jonathan
-- 
Jonathan Matthews // Oxford, London, UK
http://www.jpluscplusm.com/contact.html



More information about the nginx mailing list