I have LB server which currently load balancing 2 machines as for apache2 "http" and "https" requests as master/slave,
How to make the same server load balancing "sftp" requests to the same both machines using default port "22"?
frontend ft_app
bind 1.1.1.1:80
reqadd X-Forwarded-Proto:\ http
default_backend bk_app
frontend ft_apps
bind 1.1.1.1:443 ssl crt /etc/ssl/certs/bundle.pem ca-file /etc/ssl/certs/cert.cer verify optional
reqadd X-Forwarded-Proto:\ https
default_backend bk_apps
backend bk_app
server server1 2.2.2.2:80 check
server server2 3.3.3.3:80 check backup
backend bk_apps
server servers1 2.2.2.2:443 ssl check verify none
server servers2 3.3.3.3:443 ssl check verify none backup
You might try using the following for the backend SFTP servers:
I based the above on this post: http://jpmorris-iso.blogspot.com/2013/01/load-balancing-openssh-sftp-with-haproxy.html
Hope this helps