Welcome! Log In Create A New Profile


Getting $is_args and/or $args from the original request

Posted by ibri 
Getting $is_args and/or $args from the original request
July 03, 2021 06:14PM

I'm doin some changes on Nginx, mostly in the configurations.
I need to add some info in the access log line(in $http scope, but outside $server), and it depends on whether the original request has query params or nit. $is_args would give me the answer but the problem is that there's a redirection from the request, and I shouldn't assume the original query params will be passed with it.

Since there's a redirection, I $is_args and $args are lost and don't have the original requests's params anymore.

Other than parsing $request_uri with regex, what else I can do to have the original $args/$is_args?
I also know that I can set $original_is_args = $is_args before the "return 302 ... " line, and use this variable outside server{} context, but I've seen warning from doing so. (besides, no one can guarantee what will happen first, right?)

Thanks in advance!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 97
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready