Sunday 15 April 2012

proxy - nginx as load balancer server out 404 page based on HTTP response from app server -


I am using it as a load balancer with the app server behind it. If the app does not return a 404 response to the server 404, then I would prefer 404 pages locally on that server to nginx on the server. I want to do this so that my app server is not obliged to serve a static HTML file and instead can return a response immediately and handle nginx stable stuff . Does anyone know how I can do this? Actually, I need some sort of check based on HTTP response. Is this possible? Thanks!

Just set the option for it and create a nginx error page for it.

  Error_page 404 / 404.html; Proxy_interactive_error on;   

To ensure that nginx will route the static file to this document, you must also specify the following:

  space / 404 .html {Internal; }   

I'm assuming that NGN is configured to talk to your app server as a proxy because it's the normal way and your question is any of these mentions does not do.

No comments:

Post a Comment