Skip to content

Instantly share code, notes, and snippets.

@rooftop90
Created February 26, 2020 12:37
Show Gist options
  • Save rooftop90/ea810c3df24870d0177d15e2f6c36c8b to your computer and use it in GitHub Desktop.
Save rooftop90/ea810c3df24870d0177d15e2f6c36c8b to your computer and use it in GitHub Desktop.
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode tcp
log global
option tcplog
option dontlognull
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
#---------------------------------------------------------------------
# frontend section
#---------------------------------------------------------------------
frontend www
bind ip:80
bind ip:443
default_backend webserver
#---------------------------------------------------------------------
# backend section
#---------------------------------------------------------------------
backend webserver
balance roundrobin
server web-1 ip:443 check
server web-2 ip:443 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment