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
        reqadd X-Forwarded-Proto:\ http
        default_backend bk_app

frontend ft_apps
        bind 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 check
        server server2 check backup

backend bk_apps
        server servers1 ssl check verify none
        server servers2 ssl check verify none backup

You might try using the following for the backend SFTP servers:

listen frontend_ssh
        mode tcp
        option tcplog
        balance roundrobin
        server server1
        server server2

I based the above on this post: http://jpmorris-iso.blogspot.com/2013/01/load-balancing-openssh-sftp-with-haproxy.html

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.