misunderstood regex location

dcaillibaud nginx-forum at nginx.us
Mon May 5 22:38:45 UTC 2014


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;

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 ?


Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249846,249846#msg-249846

More information about the nginx mailing list