# # debian # haproxy 1.6.9-1~bpo7+1 # global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin # stats socket ipv4@192.168.0.1:9999 level admin stats timeout 30s user haproxy group haproxy daemon # Default SSL material locations ca-base /etc/ssl/certs crt-base /etc/ssl/private # Default ciphers to use on SSL-enabled listening sockets. # For more information, see ciphers(1SSL). This list is from: # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS ssl-default-bind-options no-sslv3 defaults log global mode http option httplog option dontlognull timeout connect 5000 timeout client 50000 timeout server 50000 errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http resolvers dns nameserver google 8.8.8.8:53 nameserver opendns 208.67.222.222:53 resolve_retries 3 timeout retry 1s hold valid 10s frontend ft_wwwapps bind *:8081 mode tcp option tcplog default_backend bk_wwwapps backend bk_wwwapps mode tcp # balance roundrobin # Load Balancing algorithm option tcplog server apps1 192.168.99.109:8081 check server apps2-ip serverpubip:8081 resolvers dns check backup #server apps3 192.168.99.109:8081 check inter 5000 rise 2 fall 3 weight 40 frontend ft_ssh bind *:3333 mode tcp option tcplog default_backend bk_ssh timeout client 1h backend bk_ssh mode tcp option tcplog server ssh 192.168.99.12:22 check port 22 #backend apps_ops # mode http # balance roundrobin # Load Balancing algorithm # option httpchk ## option ssl-hello-chk # option forwardfor # server WEB1-apps serverpubip1:8081 check # server WEB2-apps serverpubip2:4443 check # server WEB3-apps serverpubip3:8081 check #listen www :8081 # mode tcp # option tcplog # balance roundrobin # server apps1 serverip1:8081 check inter 5000 rise 2 fall 3 weight 10 # server apps2 serverip2:8081 check inter 5000 rise 2 fall 3 weight 40 # server smtp3 192.168.0.4:25 checklisten smtp :25 #backend nodes # mode http # balance roundrobin # option forwardfor # http-request set-header X-Forwarded-Port %[dst_port] # http-request add-header X-Forwarded-Proto https if { ssl_fc } # option httpchk HEAD / HTTP/1.1\r\nHost:localhost # server web01 127.0.0.1:9000 check # server web02 127.0.0.1:9001 check # server web03 127.0.0.1:9002 check #haproxy stats 1.5 #listen stats *:9000 # stats enable ## stats admin if TRUE # stats uri /hastatus ## stats uri /haproxy?stats # stats hide-version # stats auth admin:79-passwd #haproxy stats 1.6 listen stats bind *:9000 stats enable stats uri /hastatus # stats hide-version stats auth admin:passwd