Welcome! Log In Create A New Profile

Advanced

Re: partial urlEncoding when using if and $request_uri

Maxim Dounin
November 11, 2013 12:34PM
Hello!

On Mon, Nov 11, 2013 at 11:35:34AM -0500, mte03 wrote:

> Hi,
>
> I can confirm that using named variables solves the issue (as stated in the
> ticket - maybe you can add my findings (rewrite log) to the ticket comments,
> as I have no rights to do so). Both

You actually have rights to do so (though some login is required).
But as the ticket already shows how to reproduce the problem, I
don't think linking a rewrite log will be beneficial.

> if ($request_uri ~ ^/[^\/]+(?<match>/.*)$ ) { set $patch $match; }
> and
> if ($request_uri ~ ^/[^\/]+(?<path>/.*)$ ) { set $match abc; }
>
> do work correctly. However, from the performance standpoint, is this
> solution with IF faster (or more recommended) than doing st. like
>
> map $request_uri $path {
> ~^/[^\/]+(?<param>/.*)$ $param;
> }
>
> Is there any way to further improve performance on this kind of matching?

I don't think there is a measurable performance difference. Use
of map{} might be a bit better as it doesn't involve if(), see
http://wiki.nginx.org/IfIsEvil.

--
Maxim Dounin
http://nginx.org/en/donation.html

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

partial urlEncoding when using if and $request_uri

mte03 November 11, 2013 09:51AM

Re: partial urlEncoding when using if and $request_uri

mte03 November 11, 2013 11:01AM

Re: partial urlEncoding when using if and $request_uri

Maxim Dounin November 11, 2013 11:04AM

Re: partial urlEncoding when using if and $request_uri

mte03 November 11, 2013 11:35AM

Re: partial urlEncoding when using if and $request_uri

Maxim Dounin November 11, 2013 12:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
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