Get rid of args from $request_uri

Lucas Rolff lucas at
Tue Aug 8 15:55:55 UTC 2017

I use the set_misc module from openresty and do something like:

    if ($request_uri ~ "([^/?]*)(?:\?|$)") {
      set $double_encoded_filename $1;
    set_unescape_uri $encoded_uri $double_encoded_uri;

Can probably be improved, but I can use $encoded_uri and get the reslt you’re looking for c0nw0nk.

From: nginx <nginx-bounces at> on behalf of Zhang Chao <zchao1995 at>
Reply-To: "nginx at" <nginx at>
Date: Tuesday, 8 August 2017 at 16.07
To: "nginx at" <nginx at>
Subject: Re: Get rid of args from $request_uri

On 8 August 2017 at 22:02:32, chilly_bang (nginx-forum at<mailto:nginx-forum at>) wrote:
c0nw0nk Wrote:
> why don't you use
> $uri

Is it not so, that $uri will output an encoded url?

$uri is always the one decode once time and merge the slash(if you enable it).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list