Forum: NGINX Directly redirecting prefix location to named one

1266aa99d1601b47bbd3ec22affbb81c?d=identicon&s=25 B.R. (Guest)
on 2014-05-15 03:00
(Received via mailing list)
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.*
Ba5061f1803f9ab0cfc3d53366d49546?d=identicon&s=25 Lord Nynex (Guest)
on 2014-05-16 02:52
(Received via mailing list)
http://wiki.nginx.org/HttpEchoModule#echo_exec

I use this model in some parts of my configs. I, however, use openresty
and
I'm not clear if there are any functionality differences between them.
37f3ea777f96500b332a1a89d6027897?d=identicon&s=25 Yichun Zhang (agentzh) (Guest)
on 2014-05-16 22:27
(Received via mailing list)
Hello!

On Thu, May 15, 2014 at 5:52 PM, Lord Nynex wrote:
> http://wiki.nginx.org/HttpEchoModule#echo_exec
>
> I use this model in some parts of my configs. I, however, use openresty and
> I'm not clear if there are any functionality differences between them.
>

No difference here. OpenResty bundles this ngx_echo module directly.

Regards,
-agentzh
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.