blob: 94b22d87382e3212b121ebdc04f8b46aab94bcac [file] [log] [blame]
global
log 127.0.0.1 local0
log 127.0.0.1 local1 debug
tune.ssl.default-dh-param 2048
maxconn 4096
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
timeout connect 5000
timeout client 50000
timeout server 50000
frontend haproxynode
bind *:$HA_GERRIT_CANONICAL_PORT
$HA_HTTPS_BIND
mode http
acl redirect_reads url_reg -i git-upload-pack
acl redirect_reads url_reg -i clone.bundle
acl redirect_writes url_reg -i git-receive-pack
use_backend read-backendnodes if redirect_reads
use_backend write-backendnodes if redirect_writes
default_backend read-backendnodes
frontend git_ssh
bind *:$SSH_ADVERTISED_PORT
option tcplog
mode tcp
timeout client 5m
default_backend ssh
backend read-backendnodes
mode http
balance source
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
default-server inter 10s fall 3 rise 2
option httpchk GET /config/server/healthcheck~status HTTP/1.0
http-check expect status 200
server node1 $HA_GERRIT_SITE1_HOSTNAME:$HA_GERRIT_SITE1_HTTPD_PORT check inter 10s
server node2 $HA_GERRIT_SITE2_HOSTNAME:$HA_GERRIT_SITE2_HTTPD_PORT check inter 10s backup
backend write-backendnodes
mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
default-server inter 10s fall 3 rise 2
option httpchk GET /config/server/healthcheck~status HTTP/1.0
http-check expect status 200
server node1 $HA_GERRIT_SITE1_HOSTNAME:$HA_GERRIT_SITE1_HTTPD_PORT check inter 10s
server node2 $HA_GERRIT_SITE2_HOSTNAME:$HA_GERRIT_SITE2_HTTPD_PORT check inter 10s backup
backend ssh
mode tcp
option redispatch
option httpchk GET /config/server/healthcheck~status HTTP/1.0
balance roundrobin
timeout connect 10s
timeout server 5m
server ssh_node1 $HA_GERRIT_SITE1_HOSTNAME:$HA_GERRIT_SITE1_SSHD_PORT check inter 10s check port $HA_GERRIT_SITE1_HTTPD_PORT inter 10s
server ssh_node2 $HA_GERRIT_SITE2_HOSTNAME:$HA_GERRIT_SITE2_SSHD_PORT check inter 10s check port $HA_GERRIT_SITE2_HTTPD_PORT inter 10s backup