Directly redirecting prefix location to named one

B.R. reallfqq-nginx at yahoo.fr
Thu May 15 00:58:31 UTC 2014


I am considering the following locations:

location / {
    proxy_pass http://upstream;
}

location /documents/ {
    try_files $uri @upstream;
}

location @upstream {
    proxy_pass http://upstream;
}

I would like to have a single named location to handle all fallbacks to
upstream (to avoid duplication: maintenance will be easier!).

How does one redirect a prefix location directly to a named one?
Using try_files might expose documents which are not supposed to be served
outside of the /documents/ tree.

Using rewrite? I learned here to avoid it as much as possible...
---
*B. R.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140515/09d6fa03/attachment.html>


More information about the nginx mailing list