Skip to content

Instantly share code, notes, and snippets.

@onicollet
Last active August 29, 2015 14:02
Show Gist options
  • Save onicollet/abf0f97710b35bc2c700 to your computer and use it in GitHub Desktop.
Save onicollet/abf0f97710b35bc2c700 to your computer and use it in GitHub Desktop.
HAPROXY sample conf
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 10000
timeout server 10000
option httpclose
frontend http
bind :80
acl is_for_server1 path_beg /test1/
use_backend server1 if is_for_server1
acl is_for_server2 path_beg /test2/
use_backend server2 if is_for_server2
backend server1
option forwardfor
reqrep ^([^\ :]*)\ /test1/(.*) \1\ /\2
server http1 127.0.0.1:8081
backend server2
option forwardfor
reqrep ^([^\ :]*)\ /test2/(.*) \1\ /\2
server http2 127.0.0.1:8082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment