Welcome! Log In Create A New Profile

Advanced

Re: "root" directive weirdness

Marcus Clyne
January 22, 2010 01:46AM
Cliff Wells wrote:
> On Fri, 2010-01-22 at 05:15 +0200, Marcus Clyne wrote:
>
>> Cliff Wells wrote:
>>
>>> On Fri, 2010-01-22 at 02:45 +0200, Marcus Clyne wrote:
>>>
>>>
>>>>>
>>>>>
>>>>>
>>>> but using
>>>>
>>>> location ^~ /users/ {
>>>> root /web;
>>>> }
>>>>
>>>> is more efficient than using
>>>>
>>>> location /users {
>>>> root /web;
>>>> }
>>>>
>>>>
>>> That's not true. The regex is less efficient.
>>>
>>>
>> It's not a regex (regexes are indicated by ~*). It's a test for the URL
>> beginning with the represented string. If found, it does not test any
>> regexes. Using just
>>
>> location /users
>>
>> will test regexes before returning the /users location if no regexes match.
>>
>
> I stand corrected. I should have read the documentation you so
> thoughtfully linked to =)
>
:-)

I'm actually not a huge fan of the ^~ syntax. I think it's confusing,
because it does more closely resemble the regex syntax than a static
one. I suspect that a lot of people don't use it because of this,
thinking that it will be less efficient when in fact it is more so.

I think ^= would be less confusing, or even just plain ^, but I doubt
that it'll get changed.

Cheers,

Marcus.

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

"root" directive weirdness

Dennis J. January 21, 2010 04:16PM

Re: "root" directive weirdness

Cliff Wells January 21, 2010 06:12PM

Re: "root" directive weirdness

Marcus Clyne January 21, 2010 07:52PM

Re: "root" directive weirdness

Cliff Wells January 21, 2010 08:02PM

Re: "root" directive weirdness

Marcus Clyne January 21, 2010 10:18PM

Re: "root" directive weirdness

Cliff Wells January 22, 2010 01:18AM

Re: "root" directive weirdness

Marcus Clyne January 22, 2010 01:46AM

Re: "root" directive weirdness

Dennis J. January 22, 2010 08:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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