# How Does Nginx forward connections?

**URL:** <https://www.ruby-forum.com/t/how-does-nginx-forward-connections/244271>\
**Category:** NGINX\
**Created:** [March 13, 2016, 3:00pm UTC](https://www.ruby-forum.com/t/how-does-nginx-forward-connections/244271 "2016-03-13T15:00:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [March 13, 2016, 3:00pm UTC](https://www.ruby-forum.com/t/how-does-nginx-forward-connections/244271/1 "2016-03-13T15:00:12Z")

</div>

Hello All,

I am thinking, how does Nginx forward TCP connections. Does it create a  
single TCP connection to backend server (considering single backend) or  
as  
many as clients connected to the Nginx proxy. What I mean to say is, as  
Nginx Proxy receives a client connection, it must call Accept and create  
a  
new Socket connection and call Connect on it every time, it receives a  
new  
client connection.  
Or does it create a single Socket to the backend at the start of Nginx  
and  
basically sends the data over this single connection. If it is a single  
connection, how does Nginx knows which client to reply when it receives  
reply from the backend server.

How does it work?

Can anyone please provide some details?

Thanks,  
Raul

–  
View this message in context:  
[http://nginx.2469901.n2.nabble.com/How-Does-Nginx-forward-connections-tp7596539.html](http://nginx.2469901.n2.nabble.com/How-Does-Nginx-forward-connections-tp7596539.html)  
Sent from the nginx mailing list archive at [Nabble.com](http://Nabble.com).
