Hey folks,<div><br></div><div>We've got the following scenario occurring in production. The solution is non-obvious... to me, at least.</div><div><br></div><div>[client] ==> [nginx] ==> [service S]</div><div><br>
</div><div>* nginx fronting 2 application servers which provide a service S. (Primary and backup, both running Trinidad. Trinidad is a JRuby/Rails wrapper for Tomcat.)</div><div>* hot-deploying a rails (jruby) app into Trinidad causes Trinidad to return a 404 to nginx</div>
<div>* nginx returns the 404 to the application. In this particular case, the client is another service which expects service S to remain live during deployments</div><div><br></div><div>So, nginx does provide an "http_404" case for the "proxy_next_upstream" directive. However, this would require the "max_fails" setting to pertain to 404s, which it doesn't... otherwise legitimate 404s produce an infinite loop.</div>
<div><br></div><div>Is there something like "max_fails" for 404s?</div><div>Is there another solution to this problem?</div><div>Is it Trinidad's fault for returning 404s and not 503s? (I would say it is but I can't find a solution to that problem just yet.)</div>
<div><br></div><div>Thanks!</div><div>-steven</div>