# Reg. nginx\_tcp\_proxy\_module

**URL:** <https://www.ruby-forum.com/t/reg-nginx-tcp-proxy-module/228460>\
**Category:** NGINX\
**Created:** [April 23, 2013, 8:29am UTC](https://www.ruby-forum.com/t/reg-nginx-tcp-proxy-module/228460 "2013-04-23T08:29:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eswar\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e47774/32.png) [@eswar\_r](https://www.ruby-forum.com/u/eswar_r)\
**Post date:** [April 23, 2013, 8:29am UTC](https://www.ruby-forum.com/t/reg-nginx-tcp-proxy-module/228460/1 "2013-04-23T08:29:50Z")

</div>

Hi All,

I have a below setup:

netcat client (nc localhost 8081) =====\>nginx server(8081) with  
tcp\_proxy  
module=====\>2 netcat servers(8031 and 8032)

$ nc localhost 8081  
biiiiiiiiiiiiiiiiii

$ nc -lk 8031  
biiiiiiiiiiiiiiiiii

$ nc -lk 8032

If I kill the process $ nc -lk 8031, the client is also getting killed.

I expect the nginx server would read 0 bytes upon closing the connection  
to  
8031 server and it detects the server failover and it establishes the  
connection to 8032 server so that the clients won’t experience any  
downtime. Since the client establishes connection to only nginx at 8081,  
it  
should be shielded from failover of 8031 server.

Can anyone please help me if my understanding is wrong ??

Thanks  
Eswar Rao

---

<div class="post-metadata">

**Author:** ![eswar\_r](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e47774/32.png) [@eswar\_r](https://www.ruby-forum.com/u/eswar_r)\
**Post date:** [April 23, 2013, 9:04am UTC](https://www.ruby-forum.com/t/reg-nginx-tcp-proxy-module/228460/2 "2013-04-23T09:04:53Z")

</div>

Hello!

On Tue, Apr 23, 2013 at 11:59:22AM +0530, ESWAR RAO wrote:

> $ nc -lk 8031  
> downtime. Since the client establishes connection to only nginx at 8081, it  
> should be shielded from failover of 8031 server.
> 
> Can anyone please help me if my understanding is wrong ??

While I’m not really familiar with 3rd party tcp\_proxy module, the  
“reestablishing” connection would be really unexpected behaviour -  
as the module doesn’t know anything about the protocol and can’t  
assume there is no states associated with a connection on a client  
and/or on a server.

That is, just dropping the connection looks correct. What the  
module can do is to select a working server on connection  
establishment.

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**
