Transfering url arguments to different location

Jonathan Matthews contact at
Wed Apr 2 09:11:17 UTC 2014

On 2 Apr 2014 07:31, "Cristian Rusu" <crirus at> wrote:
> Hello
> I have a setup on nginx to count downloads.
> location / {.
>             post_action /afterdownload;
> Here I have a value in $arg_key
> location /afterdownload {
> I need $arg_key here
> Any way to send it to /afterdownload section?

I believe it's available as a variable in that section already. You can add
it as a custom header or path component however you're most comfortable.
But why not reference it in the post_action statement? (I don't know that
post_action /can/ take variables, so this suggestion might be null and void
in the face of the documentation ... :-))

As an aside, IIRC people @nginx have stated publicly that post_action is a
hack, and that its behaviour should not be relied on. I'm without Internets
right now so can't find you the quote, but it was sufficient to put me off
using it for an audit function a while back. Plus it pollutes your access
logs with the final URI and/or response code served, not the first.

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

More information about the nginx mailing list