Welcome! Log In Create A New Profile

Advanced

misunderstood regex location

May 05, 2014 06:38PM
Hi,

I understood that prefix location was read, then regex location and it stops on a ^~ match

Why with this config

location / {
location ~ .+\.(js|css|ico|png|gif|jpg|jpeg|pdf|zip|html|htm)$ {
expires 25h;
}
}

location ^~ /banniere_rotative/.+\.(js|css)$ {
expires 30d;
}

https://ssl.sesamath.net/banniere_rotative/_writable/slides_20140503c.min.css
match the first one prefix location and not the second regex one ?

After deeper tests, I saw that

location /banniere_rotative/ {
location ~ \.(js|css)$ {
expires 30d;
}
}

match but

location ^~ "/banniere_rotative/.*\.css$" {

doesn't (inside prefix location or not)

What's the obvious mistake I made in my regex ?

Thanks
Subject Author Posted

misunderstood regex location

dcaillibaud May 05, 2014 06:38PM

Re: misunderstood regex location

Francis Daly May 05, 2014 07:42PM

Re: misunderstood regex location

Igor Sysoev May 06, 2014 02:56AM

Re: misunderstood regex location

dcaillibaud May 06, 2014 11:03AM

Re: misunderstood regex location

B.R. May 06, 2014 01:28PM

Re: misunderstood regex location

dcaillibaud May 06, 2014 02:39PM

Re: misunderstood regex location

dcaillibaud May 06, 2014 02:53PM

Re: misunderstood regex location

B.R. May 07, 2014 09:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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