I have one tomcat instance serving requests and I have nginx as reverse-proxy for this tomcat instance.
When I update my Java Application, it took around 10 seconds. But those 10 seconds site is down and nginx returns HTTP 503 page.
What I would like for nginx to do is: pause all incoming connections until backend is up. Then start to serve them. Ideally do some intelligent check, e.g. "/" returns HTTP 200. In my opinion it's better for user to wait 10 seconds than see HTTP 503 page.
I don't want clustering for that. I use in-app caches and my web application is far from high loaded. Clustering would introduce a lot of problems I don't want to spend time on.
I use the following directive to connect to tomcat: