Cache only static files in sub/subfolder but not sub

Francis Daly francis at daoine.org
Mon Feb 20 19:06:14 UTC 2017


On Sun, Feb 19, 2017 at 02:53:22PM -0500, JoakimR wrote:

Hi there,

> Now the trouble shooting: as noticed above, this only works when I out
> comments the second location, which is NOT to be cached at all. I have of
> course tried to switch between which location comes first. Even chose I
> recall it as first rule matching is served first.
> 
> Any one who can tell me why this isn't working as i like it to?

>   location /thumbs/embedded {

> ##Match what's not in above location directive
>     location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {

It looks to me like you want "match the prefix location, and then do
not check the regex locations".

There's a squiggle for that. http://nginx.org/r/location

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list