Transfering url arguments to different location

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


On 2 Apr 2014 07:31, "Cristian Rusu" <crirus at gmail.com> 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.

HTH,
J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140402/2acb6916/attachment-0001.html>


More information about the nginx mailing list