<div>Maxim,</div><div><br></div><div>Thanks for your quick reply!</div><div><br></div><div>I should have included that in both cases, the default handler is this:</div><div><br></div><div><div>    location / {</div><div>      try_files $uri $uri/index.html @mongrel_app;</div>

<div>    }</div><div><br></div><div>And, there is no /archives/ handler. So, here are the snippets that I think are relevant. Working:</div><div><br></div><div><meta charset="utf-8">    location ^~ /providers/ {<br>      error_page 404 = @archives;</div>

<div>      log_not_found off;<br>    }<br>    location @archives {<br>      rewrite &quot;/providers/(.*)&quot; /archives/providers/$1 last;<br>    }<br></div><meta charset="utf-8"><div>    location / {</div><div>      try_files $uri $uri/index.html @mongrel_app;</div>

<div>    }</div><div><br></div><div>Not working:</div><div><br></div><div><meta charset="utf-8">    location ^~ /providers/ {<br>      try_files $uri /archives$uri @mongrel_app;<br>    }<br></div><div><meta charset="utf-8"><div>

    location / {</div><div>      try_files $uri $uri/index.html @mongrel_app;</div><div>    }</div></div><div><br></div><div>Also, I should mention that it in the not-working case, the behavior is that it will correctly find the file in /providers/... but if the file is moved to /archives/providers/..., it will no longer find it.</div>

<div><br></div><div>I&#39;ve put all the location directives here: <a href="http://pastie.org/1438414">http://pastie.org/1438414</a></div><div><br></div><div>Thanks, again,</div><div><br></div><div>Aaron</div><div><br></div>

<div><br></div><div class="gmail_quote">On Fri, Jan 7, 2011 at 1:03 PM, Maxim Dounin <span dir="ltr">&lt;<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>&gt;</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 Fri, Jan 07, 2011 at 11:41:06AM -0800, Aaron Starr wrote:<br>
<br>
&gt; Hello, all.<br>
&gt;<br>
&gt; nginx version: nginx/0.7.67<br>
&gt;<br>
&gt; This works great to look first in fast local storage, and then fall back to<br>
&gt; slower storage for older archives:<br>
&gt;<br>
&gt;     location ^~ /providers/ {<br>
&gt;       error_page 404 = @archives;<br>
&gt;       log_not_found off;<br>
&gt;     }<br>
&gt;     location @archives {<br>
&gt;       rewrite &quot;/providers/(.*)&quot; /archives/providers/$1 last;<br>
&gt;     }<br>
<br>
</div>This rewrites to /archives/... and searches for location again.<br>
Request will be handled elsewhere, and it&#39;s not known how it will<br>
be handled from the config snippet provided.<br>
<div class="im"><br>
&gt; I thought I could tidy this up by doing the following, but it doesn&#39;t work:<br>
&gt;<br>
&gt;     location ^~ /providers/ {<br>
&gt;       try_files $uri /archives$uri @mongrel_app;<br>
&gt;     }<br>
&gt;<br>
&gt; Anyone see why? Thanks in advance.<br>
<br>
</div>This should work as long as root for archives matches one for<br>
providers.  But won&#39;t work as long as you have something like<br>
<br>
    location ^~ /archives/ {<br>
        root /path/to/another/storage;<br>
    }<br>
<br>
in your config.<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://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>