# Reg. automatic failover

**URL:** <https://www.ruby-forum.com/t/reg-automatic-failover/228096>\
**Category:** NGINX\
**Created:** [April 9, 2013, 2:36pm UTC](https://www.ruby-forum.com/t/reg-automatic-failover/228096 "2013-04-09T14:36:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ESWAR\_RAO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@ESWAR\_RAO](https://www.ruby-forum.com/u/ESWAR_RAO)\
**Post date:** [April 9, 2013, 2:36pm UTC](https://www.ruby-forum.com/t/reg-automatic-failover/228096/1 "2013-04-09T14:36:26Z")

</div>

Hi All,

I observed that automatic failover behaviour is not working with my  
nginx  
server.

# /opt/nginx/sbin/nginx -v

nginx version: nginx/1.2.8

nginx server is running with following conf:

upstream lb\_get {  
server localhost:8031 ;  
server localhost:8032 ;  
}  
server {  
listen 8081;  
…  
}  
location / {  
proxy\_pass http://lb\_get;  
…  
}

I have two servers running as:  
$ nc -kl 8031 $ nc -kl 8032

From another machine:

# curl ‘[http://192.168.2.94:8081](http://192.168.2.94:8081)’

$ nc -kl 8031  
GET / HTTP/1.0  
Host: 192.168.2.94  
X-Real-IP: 192.168.2.52  
X-Forwarded-For: 192.168.2.52  
Connection: close  
User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1  
zlib/1.2.3.4 libidn/1.23 librtmp/2.3  
Accept: _/_

But if I kill this server the curl client is also getting killed and its  
not getting transferred to other server listening at 8032.

Can anyone provide me some insight on this issue.

Thanks  
Eswar

---

<div class="post-metadata">

**Author:** ![ESWAR\_RAO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@ESWAR\_RAO](https://www.ruby-forum.com/u/ESWAR_RAO)\
**Post date:** [April 15, 2013, 9:14am UTC](https://www.ruby-forum.com/t/reg-automatic-failover/228096/2 "2013-04-15T09:14:05Z")

</div>

Can anyone provide me some insight on this issue.

---

<div class="post-metadata">

**Author:** ![ESWAR\_RAO](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@ESWAR\_RAO](https://www.ruby-forum.com/u/ESWAR_RAO)\
**Post date:** [April 15, 2013, 1:00pm UTC](https://www.ruby-forum.com/t/reg-automatic-failover/228096/3 "2013-04-15T13:00:06Z")

</div>

On 9 April 2013 13:35, ESWAR RAO [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi All,
> 
> I observed that automatic failover behaviour is not working with my nginx  
> server.

What you describe is exactly what I would expect. No HTTP-compliant  
proxy would shunt an active connection, mid-request, over to another  
backend once a TCP connection has been established, and any traffic  
has been passed to it. The proxy has no way of knowing if the backend  
has taken some non-idempotent action based on as much of the request  
as managed to be communicated. Would you like it if your bank  
re-dispatched “pay this bill” requests to multiple backends just  
because one of them fell over? 😉

What are your expectations here? Be clear!

Jonathan
