Forum: NGINX Transfering url arguments to different location

D25a83016e1e1351dcf096fb3f607347?d=identicon&s=25 Cristian R. (cristian_r)
on 2014-04-02 08:32
(Received via mailing list)
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
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2014-04-02 11:12
(Received via mailing list)
On 2 Apr 2014 07:31, "Cristian Rusu" <crirus@gmail.com> 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
1266aa99d1601b47bbd3ec22affbb81c?d=identicon&s=25 B.R. (Guest)
on 2014-04-02 15:15
(Received via mailing list)
On Wed, Apr 2, 2014 at 11:11 AM, Jonathan Matthews
<contact@jpluscplusm.com>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.*
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2014-04-02 17:46
(Received via mailing list)
On 2 April 2014 14:13, B.R. <reallfqq-nginx@yahoo.fr> 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.
1266aa99d1601b47bbd3ec22affbb81c?d=identicon&s=25 B.R. (Guest)
on 2014-04-02 19:51
(Received via mailing list)
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.*
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.