global log stdout local0 user haproxy group haproxy daemon defaults mode http log global option httplog option dontlognull option log-health-checks option forwardfor except 127.0.0.0/8 option redispatch 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 2000 # Stats page frontend stats bind *:8404 stats enable stats uri /stats stats refresh 30s stats admin if LOCALHOST # Staging Frontend frontend staging_frontend bind *:80 mode http default_backend staging_web_servers # Staging Backends - using external services backend staging_web_servers balance roundrobin mode http option httpchk GET / server staging-web1 postman-echo.com:80 weight 100 check server staging-web2 httpbin.org:80 weight 100 check inter 10s fall 2 rise 3 backend staging_api_servers balance source mode http option httpchk GET /get server staging-api1 httpbin.org:80 weight 100 check server staging-api2 postman-echo.com:80 weight 75 check inter 5s fall 2 rise 2 backend staging_cache_servers balance first mode tcp option tcpchk server staging-redis1 1.1.1.1:53 weight 100 check server staging-redis2 8.8.8.8:53 weight 100 check backup