Hey folks,<div><br></div><div>We&#39;ve got the following scenario occurring in production. The solution is non-obvious... to me, at least.</div><div><br></div><div>[client] ==&gt; [nginx] ==&gt; [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 &quot;http_404&quot; case for the &quot;proxy_next_upstream&quot; directive. However, this would require the &quot;max_fails&quot; setting to pertain to 404s, which it doesn&#39;t... otherwise legitimate 404s produce an infinite loop.</div>
<div><br></div><div>Is there something like &quot;max_fails&quot; for 404s?</div><div>Is there another solution to this problem?</div><div>Is it Trinidad&#39;s fault for returning 404s and not 503s? (I would say it is but I can&#39;t find a solution to that problem just yet.)</div>
<div><br></div><div>Thanks!</div><div>-steven</div>