Skip to content

Instantly share code, notes, and snippets.

@cpjolicoeur
Forked from wkf/haproxy.cfg
Last active August 29, 2015 14:17
Show Gist options
  • Save cpjolicoeur/b82784d6a69dad3ca641 to your computer and use it in GitHub Desktop.
Save cpjolicoeur/b82784d6a69dad3ca641 to your computer and use it in GitHub Desktop.
# -*- mode: haproxy -*-
# vi: set ft=haproxy :
defaults
log global
mode http
option forwardfor
option dontlognull
option redispatch
option http-server-close
retries 3
maxconn 2000
timeout connect 5s
timeout client 1h
timeout server 1h
frontend http
bind *:9000
use_backend api if { path_beg -i /api }
use_backend riemann if { path_beg -i /events }
use_backend beaker if { path_beg -i /beaker }
default_backend web
backend api
balance roundrobin
server api-server localhost:3000
backend web
balance roundrobin
server web-server localhost:8081
backend riemann
balance roundrobin
server riemann-server localhost:5556
backend beaker
balance roundrobin
server beaker-server localhost:8801
I won't be using `path_beg` since I'm trying to match against hostnames.
Use the following instead: `hdr_dom(host) -i foo`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment