Hi there fellow forum members!
I have a bit of a fringe case and I'm hoping that perhaps someone has faed this scenario before.
I currently have an Nginx TCP proxy configured that receives SSH connections from a client and then proxies it to a remote host.
CLIENT_APP (SSH) -> NGINX_PROX -> REMOTE_SSH_HOST
This is easily enough achieved with the use of Nginx's TCP Stream module.
However, for every connection from the client, Nginx will initiate a new connection to the remote host.
Is there any way for Nginx to create a persistent connection for the each client connection so that in the event of the client temporarily losing connection, when re-established connectivity, the previous session to the Remote Host gets re-utilised ?
#Config:
stream {
upstream remote_ssh_server {
server REMOTE_HOST_1:22;
server REMOTE_HOST_2:22;
}
server {
listen 9999;
proxy_pass remote_ssh_server;
proxy_socket_keepalive on;
proxy_buffer_size 16k;
proxy_timeout 1800s;
proxy_connect_timeout 1800s;
}