I have HAProxy and 2 backend IIS web servers. When one of the main IIS app polls on one of these servers goes down, then IIS responds me with 503 error. If the client has session persistence on such a server he can see this 503 error which isn't very nice.
I am looking for any way how to avoid this scenario. Let me clarify some things:
- HAProxy is unable to do something with it. I already lowered my timeout connection and health check values to minimum and I can't go lower. Still there is this minimum time window when a client can get 503 error from IIS because HAProxy still see the backend server as healthy so it passes the 503 response.
- One thing that maybe can be done is to rewrite the error on haproxy when IIS return 503 to another custom error. However this is not a solution, it's just replacement of an error by another error.
- I was thinking about some process when HAProxy can put a user to queue when it receives 503 error from an IIS backend server. However I didn't find any configuration that can do this.
- I was thinking to put maybe nginx or another component between haproxy and backend servers. If this component will be able to put a client to a queue in case it receives 503 from IIS it would be solution. However I am not sure if such a component or solution exists...