Forum: NGINX proxy_pass check if 404, and return 404

2974d09ac2541e892966b762aad84943?d=identicon&s=25 justink101 (Guest)
on 2014-01-08 00:04
(Received via mailing list)
I am using proxy_pass to a dynamic subdomain:

    proxy_pass https://$remote_user.mydomain.io

Is it possible to have the proxy_pass check if the response of
https://$remote_user.mydomain.io is 404, if so, simply do:

    return 404;

I.E. don't proxy, immediately return.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,246112,246112#msg-246112
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2014-01-08 00:57
(Received via mailing list)
The *only* context I can see this being even slightly useful is where
you are concerned about the unacceptably large size of the upstream
server's 404 page.

If this isn't your problem, I don't understand what you're trying to
solve.
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2014-01-08 01:10
(Received via mailing list)
On 7 January 2014 23:57, Jonathan Matthews <contact@jpluscplusm.com>
wrote:
> The *only* context I can see this being even slightly useful is where
> you are concerned about the unacceptably large size of the upstream
> server's 404 page.
>
> If this isn't your problem, I don't understand what you're trying to solve.

Either way, I should have said, look at the error_page directive.

HTH,
J
40b4c848b8fcd63b0cb60b9d170c3a77?d=identicon&s=25 Valentin V. Bartenev (Guest)
on 2014-01-08 05:21
(Received via mailing list)
On Wednesday 08 January 2014 00:10:16 Jonathan Matthews wrote:
> On 7 January 2014 23:57, Jonathan Matthews <contact@jpluscplusm.com> wrote:
> > The *only* context I can see this being even slightly useful is where
> > you are concerned about the unacceptably large size of the upstream
> > server's 404 page.
> >
> > If this isn't your problem, I don't understand what you're trying to
> > solve.
>
> Either way, I should have said, look at the error_page directive.

..and "proxy_intercept_errors".

http://nginx.org/r/proxy_intercept_errors

 wbr, Valentin V. Bartenev
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.