Skip to content

Instantly share code, notes, and snippets.

@jidckii
Created November 10, 2017 09:26
Show Gist options
  • Save jidckii/5ceb34491c83f2e3a5fab090166931d5 to your computer and use it in GitHub Desktop.
Save jidckii/5ceb34491c83f2e3a5fab090166931d5 to your computer and use it in GitHub Desktop.
haproxy.cfg
global
daemon
maxconn 4096
log 172.17.0.1:514 local0
stats socket /var/run/haproxy.sock mode 600
defaults
log global
retries 7
option httplog
option redispatch
mode http
timeout connect 10000ms
timeout client 300000ms
timeout server 300000ms
timeout check 5000ms
resolvers mydns
nameserver dns1 192.168.100.1:53
nameserver dns2 192.168.100.2:53
frontend http
bind *:80
default_backend bix
backend bix
option httpchk get /
# http-check expect status 200
http-check expect string <!DOCTYPE html>
balance roundrobin
option forwardfor
cookie SRVNAME insert
server bix1 bix1:80 cookie bix1 check resolvers mydns resolve-prefer ipv4
server bix2 bix2:80 cookie bix2 check resolvers mydns resolve-prefer ipv4
listen stats
bind *:81
stats enable
stats uri /stats
stats realm Global\ statistics
stats auth admin:admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment