Skip to content

Failover

To provide failover capability for your Surfly setup, you will need at least 2 servers running the same version of Surfly application and a load balancer to handle failover.

Surfly doesn’t require any specific load balancer to make failover work. Please check the configuration example for HAProxy:

global
log 127.0.0.1 local0 debug
user haproxy
group haproxy
defaults
log global
mode tcp
option tcplog
maxconn 10000
timeout connect 5s
timeout queue 5s
timeout client 40s
timeout server 120s
# Make statistic available on /stat (Optional)
listen stats
bind 192.168.33.10:1936
mode http
log global
maxconn 10
stats enable
stats refresh 5s
stats show-node
stats auth user:password
stats uri /stat
frontend lb_http
bind :::80 v4v6
mode http
redirect scheme https if !{ ssl_fc }
frontend lb
bind :::443 v4v6
default_backend surfly_servers
backend surfly_servers
fullconn 10000
mode tcp
server main 192.168.33.11:4433 check port 443 on-marked-up shutdown-backup-sessions send-proxy-v2
server failover 192.168.33.12:4433 check port 443 backup send-proxy-v2

When main server 192.168.33.11 is down, all traffic is switched to the backup server 192.168.33.12.