Using Nginx for TCP Mirroring

Roman Arutyunyan arut at nginx.com
Thu Aug 16 13:32:31 UTC 2018


Hi,

On Thu, Aug 16, 2018 at 08:56:22AM -0400, ankitschopra wrote:
> Hi,
> 
> Can any one help in using Nginx for TCP mirroring.  i.e We want to send 1
> TCP request to 2 servers.

There's no such module in nginx.  The stream (TCP) module has no information
about the underlying protocol.  This means that it's not aware what is a request
and where it ends.

However, it is really interesting to know your use case.  You want to mirror
the request (let's assume we have information about the protocol), but what
about the response?

> There is a module ngx_http_mirror_module,
> http://nginx.org/en/docs/http/ngx_http_mirror_module.html which can do http
> mirroring, but we want to do for TCP mirroring.  

The HTTP mirror module is in fact way more generic than that.  It just creates
a background subrequest, which may proxy the request to a remote server and do a
bunch of other things.

-- 
Roman Arutyunyan


More information about the nginx mailing list