# Production HAProxy Configuration Example # This can be used with HttpHound's production mode global daemon maxconn 4096 log /dev/log local0 log /dev/log local1 notice # chroot /var/lib/haproxy # stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s defaults log global mode http option httplog option dontlognull timeout connect 5000 timeout client 50000 timeout server 50000 # Frontend - receives client requests frontend web_frontend bind *:80 #bind *:443 ssl crt /etc/ssl/certs/haproxy.pem # ACLs acl is_api path_beg /api acl is_static path_beg /static /images /css /js # Routing use_backend api_backend if is_api use_backend static_backend if is_static default_backend app_backend # Backend - application servers backend app_backend balance roundrobin option httpchk GET /health http-check expect status 200 # These will be patched by HttpHound in production mode server app1 10.0.1.10:8080 server app2 10.0.1.11:8080 server app3 10.0.1.12:8080 # API backend backend api_backend balance leastconn option httpchk GET /api/health server api1 10.0.2.10:9000 check server api2 10.0.2.11:9000 check # Static content backend backend static_backend balance roundrobin server static1 10.0.3.10:80 check server static2 10.0.3.11:80 check # Stats page listen stats bind *:8404 stats enable stats uri /stats stats refresh 30s stats admin if TRUE