Hi Ignor
On Fri, Dec 14, 2012 at 8:37 PM, Igor Sysoev <igor@sysoev.ru> wrote:
>
>
> This valid only if "~* /b" was intended for "~* ^/b".
>
> As to me, I prefer to isolate regex locations (if I have to use them at
> all)
> inside usual locations:
>
> location /c {
> location ~* \.(?:css|js|jpg|jpeg|gif|png)$ {
> expires 1y;
> }
> }
>
>
My issue is in nginx, url can only be matched to only ONE location, unlike
in Apache we have something like * ExpiresByType*, seems duplicate
multiple locations is a must in nginx.
e.g.
location ~* /a {
location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ {
expires 1y;
}
# more unique config for /a, cannot be combined
}
location ~* /b {
location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ {
expires 1y;
}
# more unique config for /b, cannot be combined
}
location ~* /c {
location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ {
expires 1y;
}
# more unique config for /c, cannot be combined
}
Any better way?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx