Welcome! Log In Create A New Profile

Advanced

Re: Adding $request_path Variable

António P. P. Almeida
June 18, 2012 03:50PM
On 17 Jun 2012 02h43 CEST, nginx-forum@nginx.us wrote:

> It would be very nice if someone would add the following variable to
> Nginx:
>
> $request_path
>
> Right now, we have $request_uri which includes the query string of
> the original request. We also have the $uri which is the path
> portion of the $request_uri, but it is the path AFTER the rewrites.
> What would be very useful is the $request_path, which would be the
> original path portion of the $request_uri.

If I understand your problem you want to keep the original URI in a
variable to log it later.

Try setting a variable at the server level. Note that both set and
rewrite happen at the rewrite phase. So if you have server level
rewrites, make sure the variable is set *before* the rewrites appear.

server { #...

set $orig_uri $uri; # $orig_uri is the variable having the

# Rewrites can happen below here

#... log $orig_uri

}

--- appa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Adding $request_path Variable

adamchal June 16, 2012 08:43PM

Re: Adding $request_path Variable

António P. P. Almeida June 18, 2012 03:50PM

Re: Adding $request_path Variable

adamchal July 02, 2012 09:44AM

Re: Adding $request_path Variable

adamchal August 29, 2012 06:25AM

Re: Adding $request_path Variable

kolbyjack August 29, 2012 07:56AM

Re: Adding $request_path Variable

adamchal August 29, 2012 09:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 229
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready