Skip to content

Instantly share code, notes, and snippets.

@boris
Created January 7, 2014 14:21
Show Gist options
  • Select an option

  • Save boris/8299978 to your computer and use it in GitHub Desktop.

Select an option

Save boris/8299978 to your computer and use it in GitHub Desktop.
haproxy balance by uri. if the uri is www.something.com/something, traffic will be forwarded to front-3
frontend front-in
bind 0.0.0.0:80
acl custom_uri path_beg /something
use_backend super_server if custom_uri
default_backend all_servers
backend all_servers
balance roundrobin
option httpclose
option forwardfor
server front-1 1.1.1.1 front-1 check
server front-2 1.1.1.2 front-2 check
backend super_server
balance roundrobin
option httpclose
option forwardfor
server front-3 1.1.1.3 front-3 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment