Skip to content

Instantly share code, notes, and snippets.

@kerren
Created September 22, 2018 14:59
Show Gist options
  • Select an option

  • Save kerren/8823eaba5bfc44d31abddcf013210646 to your computer and use it in GitHub Desktop.

Select an option

Save kerren/8823eaba5bfc44d31abddcf013210646 to your computer and use it in GitHub Desktop.
The HAProxy config on the barebone server
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 10s
timeout client 60s
timeout server 60s
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
frontend http_bind
bind *:80
mode tcp
option tcplog
default_backend router_http
frontend https_bind
bind *:443
mode tcp
option tcplog
default_backend router_https
backend router_http
mode tcp
server router_server router:80
backend router_https
mode tcp
server router_server router:443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment