How it works...
In our recipe, we define an upstream block, which is virtually identical to our HTTP load balancer configurations. We also specified a hash against the client's IP ($remote_addr), as any application which only has internal session tracking for authentication or similar would require re-authentication against each upstream server if new connections are made.
We have three upstream servers specified for this recipe, which again are against the loopback interface on the local server. Each instance of your TCP applications would need to be listening on 127.0.0.1 on ports 8101, 8102, and 8103 individually.
Our server block directive then tells NGINX to listen on port 7400. As we haven't specified a protocol, it will default to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access