Transfering url arguments to different location

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?

Thank you

On 2 Apr 2014 07:31, “Cristian R.” [email protected] wrote:

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

On Wed, Apr 2, 2014 at 11:11 AM, Jonathan M.
[email protected]wrote:

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.

​If someone had details about reasons not to use post_action (either
from
the referenced IIRC discussion or from other sources), I would be very
interested in them​.

B. R.

On 2 April 2014 14:13, B.R. [email protected] wrote:

If someone had details about reasons not to use post_action (either from the
referenced IIRC discussion or from other sources), I would be very
interested in them.

http://forum.nginx.org/read.php?2,213627,213722#msg-213722 and the
note on the wiki next to the post_action documentation, which I
believe refers to that same post.

Thanks Jonathan!
However, not much details on why it is a ‘hack’ not to be trusted since
unreliable.

I do not rely on the Wiki anymore, and since Maxim specifically says it
should be removed… I hope it will be, to prevent unreliable
configurations to be shared and propagated based on unofficial
directives.

Any decision made yet?

B. R.