Ok thanks, my problem isnt with the matching order (bad explination on my part) but more with the matching procedure<div><br></div><div>e.g</div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>location ~ to_cache {</div><div> proxy_cache ....;</div><div> proxy_pass ....;</div><div>}</div><div><br></div><div><div>location ~ not_to_cache {</div><div> proxy_cache off;</div><div> proxy_pass ....;</div>
<div>}</div></div><div><br></div><div>/</div><div>If the url /abc-not_to_cache-def/ is passed to nginx does the server execute both the matches (to_cache, then not_to_cache with not_to_cache overriding to_cache) or does it stop after the first match (to_cache)?</div>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div></div><div><br><br><div class="gmail_quote">On Tue, Jun 26, 2012 at 1:02 AM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<div class="im"><br>
On Tue, Jun 26, 2012 at 12:30:13AM +1000, SplitIce wrote:<br>
<br>
> Ok, Ive been working on a project for a long time. It involves automated<br>
> config file building for the nginx web server :)<br>
> Now im adding caching. The user of the software can using the interface<br>
> select regex's to apply caching logic to.<br>
><br>
> Ive devided the cache types into 3 types:<br>
> 1. CACHE: Cache if possible<br>
> 2. FORCE-CACHE: Cache always, ignore Cache-Control headers<br>
> 3. NEVER CACHE<br>
><br>
> all other traffic is caught by the default "/" location. Execution order<br>
> for these statements is from 1->3 (e.g 3 should override 1).<br>
><br>
> I have a couple questions:<br>
><br>
> 1) How can I ignore the effect of cache control on caching?<br>
> proxy_hide_header?<br>
<br>
</div><a href="http://nginx.org/r/proxy_ignore_headers" target="_blank">http://nginx.org/r/proxy_ignore_headers</a><br>
<div class="im"><br>
> 2) What is the most efficient order to acheive this caching override<br>
> system, my origional idea was to just use location blocks like<br>
><br>
> location ~ to_cache {<br>
> proxy_cache ....;<br>
> proxy_pass ....;<br>
> }<br>
><br>
> location ~ not_to_cache {<br>
> proxy_cache off;<br>
> proxy_pass ....;<br>
> }<br>
><br>
> location / {<br>
> proxy_pass ....;<br>
> }<br>
><br>
> is this right? Im not really sure I understand the wiki text on matching<br>
> order.<br>
<br>
</div>Try official docs instead, it might be better:<br>
<br>
<a href="http://nginx.org/r/location" target="_blank">http://nginx.org/r/location</a><br>
<br>
Maxim Dounin<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>