Reverse proxy for tcp stream

백종선 jongsun89 at
Wed Oct 13 04:27:03 UTC 2021

Thanks  Reinis
I've managed to set up for this. And succeded.
But, i have a problem after it.
I used transparency way in the referred page.
Client and upstream server are connected through linux sockets.
Here is my problem.
If upsteam server down(network also down), client does not recognize the situation . So socket connection is alive from client side. 
Actually client side should recognize it and close the connection.
How do i handle this in nginx side? 
-----Original Message-----
From: "Reinis Rozitis"<r at>
To: <nginx at>;
Sent: 2021-10-08 (금) 21:24:44 (GMT+09:00)
Subject: RE: Reverse proxy for tcp stream

> I have found for these situation , and tried proxy_bind transparency.
> But, the socket server never get connection request.
> From proxy server , timed out logs are coming.
> How can socket server behind proxy get real client ip address?

There are more steps/things you have to do to make ip transparency) work than just to enable it in nginx config - as in you have to change firewall (iptables) and routing. More detailed here:

It's more complicated than with the simple http/header approach.


nginx mailing list
nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list