Welcome! Log In Create A New Profile

Advanced

Establish TCP connection to upstream when client connection made to listener

Phillip Odam
March 20, 2020 09:58AM
Hi

I'm looking for when a client establishes a TCP connection to an IP and
port, that NGINX is listening on, that NGINX, without waiting on data
being transmitted from the client to NGINX, would establish a TCP
connection to the upstream.

If such a capability were to exist I'd have thought it'd be documented
either at http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html
or http://nginx.org/en/docs/stream/ngx_stream_core_module.html. So from
what I gather the capability does not exist in NGINX and it's quite
likely considered a good thing, NGINX won't establish a backend
connection (tying up resources) simply based on an in bound connection.

Trouble with this though, NGINX then can't fully support reverse
proxying protocols where the server provides a response upon TCP
connection eg. SSH2, MySQL. You're instead dependent on the client
handling the lack of initial server response and that after the client
sends its first lot of data it'll then receive the server's initial
response.

I've checked the way HAProxy works and it either by default establishes
the backend TCP connection upon connection to the frontend or there's
some switch I unknowingly flipped.

Presumably this isn't anything new, so please feel free to point me
towards whatever I've failed to find myself and I'm interested in
hearing others thoughts and experience with this aspect of NGINX if you
have time to share.

Cheers

Phillip

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Establish TCP connection to upstream when client connection made to listener

Phillip Odam March 20, 2020 09:58AM

Re: Establish TCP connection to upstream when client connection made to listener

Francis Daly March 20, 2020 10:44AM

Re: Establish TCP connection to upstream when client connection made to listener

Phillip Odam March 21, 2020 10:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready