Disable open_file_cache for a specific location

Peleke nginx-forum at nginx.us
Tue Jul 2 21:24:15 UTC 2013

I have set the open_file_cache variable to max=5000  inactive=20s so that it
is enabled globally but now I want to disable all caching for a specific
virtual location on a domain:

- open_file_cache max=5000  inactive=20s;
--     location ^~ /gallery {
        open_file_cache off;

Sadly that rule doesn't work because /gallery doesn't exist as a real
folder. It is only a permalink (/%category%/%postname%/) from WordPress. All
subpages (like www.domain.tld/gallery/flickr) should have no cache enabled
because the plugin for those galleries doesn't work with caching.
How can I solve the problem?
Thanks in advance.

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

More information about the nginx mailing list