Proxy_pass check if 404, and return 404


#1

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


#2

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.


#3

On 7 January 2014 23:57, Jonathan M. removed_email_address@domain.invalid
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


#4

On Wednesday 08 January 2014 00:10:16 Jonathan M. wrote:

On 7 January 2014 23:57, Jonathan M. removed_email_address@domain.invalid 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