<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 "/providers/(.*)" /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'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"><<a href="mailto:mdounin@mdounin.ru">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 Fri, Jan 07, 2011 at 11:41:06AM -0800, Aaron Starr wrote:<br>
<br>
> Hello, all.<br>
><br>
> nginx version: nginx/0.7.67<br>
><br>
> This works great to look first in fast local storage, and then fall back to<br>
> slower storage for older archives:<br>
><br>
> location ^~ /providers/ {<br>
> error_page 404 = @archives;<br>
> log_not_found off;<br>
> }<br>
> location @archives {<br>
> rewrite "/providers/(.*)" /archives/providers/$1 last;<br>
> }<br>
<br>
</div>This rewrites to /archives/... and searches for location again.<br>
Request will be handled elsewhere, and it's not known how it will<br>
be handled from the config snippet provided.<br>
<div class="im"><br>
> I thought I could tidy this up by doing the following, but it doesn't work:<br>
><br>
> location ^~ /providers/ {<br>
> try_files $uri /archives$uri @mongrel_app;<br>
> }<br>
><br>
> 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'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>