Our Situation:
We have several webservers behind a loabalancer (Astaro Security Gateway). On the webservers we run an asp.net application and we have customerrorpages configured for 404 and 500 status codes.
Now when the Application fails to start every request is redirected to the errorpage by sending status code 302 and the errorpage itself then sends a 500.
The loadbalancer sends a HEAD request to our webservers every 15 seconds to see if its still alive and if so it checks the first html status code. So it only sees the 302. Every code below 500 is treated as server is up and running.
Question:
How can we make our loadbalancing work if the application failed to start?
Edit:
By Application failed to start I mean that during the startup there were errors. Some essential parts could not be initialilzed and therefore every page fails to execute.