lua location capture

Richard Kearsley Richard.Kearsley at
Fri May 20 15:32:56 MSD 2011

Thanks for the reply
I traced the issue with the header's not being re-sent

ngx.location.capture("/some-location", { method = ngx.HTTP_HEAD })
they are not re-sent

ngx.location.capture("/some-location", { method = ngx.HTTP_GET })
they are sent

I don't know if this is correct behavior (it may well be)
I got around it by changing the headers I needed into args then re-creating them at /some-location :(

-----Original Message-----
From: agentzh [mailto:agentzh at] 
Sent: 20 May 2011 04:56
To: nginx at
Subject: Re: lua location capture

On Fri, May 20, 2011 at 5:59 AM, Richard Kearsley
<Richard.Kearsley at> wrote:
> Hi
> The lua doc at
> Says "Note that, by default, subrequests issued by ngx.location.capture
> inherit all the request headers of the current request."
> And goes on to say that it can be an unwanted feature
> In my project I actually take advantage of this feature, but for some reason
> the headers don't go through to the sub request

Could you please paste your nginx.conf here? Also, information about
your nginx's version and ngx_lua's version can also be helpful :)


nginx mailing list
nginx at

More information about the nginx mailing list