# Prevent NGINX from rerouting to a backend that was previously down

**URL:** <https://www.ruby-forum.com/t/prevent-nginx-from-rerouting-to-a-backend-that-was-previously-down/235152>\
**Category:** NGINX\
**Created:** [June 3, 2013, 6:28am UTC](https://www.ruby-forum.com/t/prevent-nginx-from-rerouting-to-a-backend-that-was-previously-down/235152 "2013-06-03T06:28:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [June 3, 2013, 6:28am UTC](https://www.ruby-forum.com/t/prevent-nginx-from-rerouting-to-a-backend-that-was-previously-down/235152/1 "2013-06-03T06:28:52Z")

</div>

I’m using NGINX’s ip\_hash directive to ensure that client requests  
always  
end up at the same backend server. In the case of a backend server  
outage,  
NGINX will reroute to the available server, and since I can listen for a  
disconnection event on my client application, I can have my client-side  
application react accordingly. However, when the previously down server  
comes back up, NGINX will route requests back to the original server.  
This  
breaks my application, as I have no way of knowing that this happens  
from my  
client-side application.

So is there a way for NGINX to send a notification event to my  
client-side  
app when it detects that a previously down server is available, or  
preferably prevent NGINX from exhibiting this behavior?

Posted at Nginx Forum:

> **[Prevent NGINX from rerouting to a backend that was previously down](https://forum.nginx.org/read.php?2,239781,239781#msg-239781)**
>
> I'm using NGINX's ip\_hash directive to ensure that client requests always end up at the same backend server. In the case of a backend server outage, NGINX will reroute to the available server, and since I can listen for a disconnection event on my...
