blob: 000ed9e7d21a5da9aae67177ba0872d369eaac40 [file] [log] [blame]
global
log $SYSLOG_SIDECAR local0
maxconn 2048
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 900000
timeout server 900000
timeout check 30000
frontend haproxynode
bind *:$HAPROXY_HTTP_PORT
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 *:$HAPROXY_SSH_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 $GERRIT_1:$GERRIT_1_HTTP check inter 10s
server node2 $GERRIT_2:$GERRIT_2_HTTP check inter 10s
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 $GERRIT_1:$GERRIT_1_HTTP check inter 10s
server node2 $GERRIT_2:$GERRIT_2_HTTP check inter 10s backup
backend ssh
mode tcp
option redispatch
option httpchk GET /config/server/healthcheck~status HTTP/1.0
http-check expect status 200
balance source
timeout connect 10s
timeout server 5m
server ssh_node1 $GERRIT_1:$GERRIT_1_SSH check inter 10s check port $GERRIT_1_HTTP inter 10s
server ssh_node2 $GERRIT_2:$GERRIT_2_SSH check inter 10s check port $GERRIT_2_HTTP inter 10s backup