G
G
Galdar Turin2020-11-19 13:45:59
Nginx
Galdar Turin, 2020-11-19 13:45:59

How to implement data transfer on two different ports?

I can't figure out how to duplicate incoming connections to two ports at once. Now with this configuration:

conf
stream 
{
    upstream backend 
    {
      server IP:PORT_1;
      server IP:PORT_2;
    }

    server 
    {
        listen 2000;
        proxy_pass backend;
    }
}
events {
    worker_connections  1024;
}

it turns out that incoming connections are floating, then they come to the first port then to the second. And it is necessary for me that one connection was duplicated. And the incoming data was on both 1 and 2 sockets. I would be glad for any help, but the same assumptions as you can do!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex McArrow, 2020-11-19
@AlexMcArrow

nginx.org/en/docs/http/ngx_http_mirror_module.html
A duplicate request is created - but keep in mind that only the main thread response will be returned to the client, the duplicate response will go to /dev/null

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question