<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">I am considering the following locations:<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">location / {<br>
</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> proxy_pass <a href="http://upstream">http://upstream</a>;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
}<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">location /documents/ {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> try_files $uri @upstream;<br>
</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">}<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">location @upstream {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
proxy_pass <a href="http://upstream">http://upstream</a>;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">}<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
I would like to have a single named location to handle all fallbacks to upstream (to avoid duplication: maintenance will be easier!).<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">How does one redirect a prefix location directly to a named one?<br>
</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Using try_files might expose documents which are not supposed to be served outside of the /documents/ tree.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
Using rewrite? I learned here to avoid it as much as possible...<br clear="all"></div><div><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div>
</div>