Skip to content

Instantly share code, notes, and snippets.

@meineerde
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meineerde/8693557 to your computer and use it in GitHub Desktop.
Save meineerde/8693557 to your computer and use it in GitHub Desktop.
Example HAProxy configuration
frontend http
bind :80
mode http
option http-server-close
# send request to the main backend until it has 50 parallel request
use_backend main if { be_conn(main) le 50 }
# send further requests to the others backend
use_backend others if { be_conn(main) gt 50 }
backend main
server main-server 102.168.1.1:80 maxconn 100
backend others
server backup1 102.168.1.11:80 maxconn 50
server backup2 102.168.1.12:80 maxconn 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment