1 # this config needs haproxy-1.1.28 or haproxy-1.2.1
5 # log 127.0.0.1 local1 notice
6 # #log loghost local0 info
8 # #chroot /usr/share/haproxy
27 #listen appli1-rewrite 0.0.0.0:10001
28 # cookie SERVERID rewrite
30 # server app1_1 192.168.34.23:8080 cookie app1inst1 check inter 2000 rise 2 fall 5
31 # server app1_2 192.168.34.32:8080 cookie app1inst2 check inter 2000 rise 2 fall 5
32 # server app1_3 192.168.34.27:8080 cookie app1inst3 check inter 2000 rise 2 fall 5
33 # server app1_4 192.168.34.42:8080 cookie app1inst4 check inter 2000 rise 2 fall 5
35 #listen appli2-insert 0.0.0.0:10002
38 # cookie SERVERID insert indirect nocache
39 # server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3
40 # server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3
41 # capture cookie vgnvisitor= len 32
43 # option httpclose # disable keep-alive
44 # rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address
46 #listen appli3-relais 0.0.0.0:10003
47 # dispatch 192.168.135.17:80
49 #listen appli4-backup 0.0.0.0:10004
50 # option httpchk /index.html
53 # server inst1 192.168.114.56:80 check inter 2000 fall 3
54 # server inst2 192.168.114.56:81 check inter 2000 fall 3 backup
56 #listen ssl-relay 0.0.0.0:8443
57 # option ssl-hello-chk
59 # server inst1 192.168.110.56:443 check inter 2000 fall 3
60 # server inst2 192.168.110.57:443 check inter 2000 fall 3
61 # server back1 192.168.120.58:443 backup
63 #listen appli5-backup 0.0.0.0:10005
66 # cookie SERVERID insert indirect nocache
67 # server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3
68 # server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3
69 # server inst3 192.168.114.57:80 backup check inter 2000 fall 3
70 # capture cookie ASPSESSION len 32
73 # option httpclose # disable keep-alive
74 # option checkcache # block response if set-cookie & cacheable
76 # rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address
78 # #errorloc 502 http://192.168.114.58/error502.html
79 # #errorfile 503 /etc/haproxy/errors/503.http
80 # errorfile 400 /etc/haproxy/errors/400.http
81 # errorfile 403 /etc/haproxy/errors/403.http
82 # errorfile 408 /etc/haproxy/errors/408.http
83 # errorfile 500 /etc/haproxy/errors/500.http
84 # errorfile 502 /etc/haproxy/errors/502.http
85 # errorfile 503 /etc/haproxy/errors/503.http
86 # errorfile 504 /etc/haproxy/errors/504.http
96 log 127.0.0.1 local1 debug
99 frontend all 0.0.0.0:80
100 timeout client 100000
101 default_backend www_backend
102 acl is_websocket hdr(Upgrade) -i WebSocket
103 acl is_websocket path_beg /socket.io/
105 use_backend socket_backend if is_websocket
109 option forwardfor # This sets X-Forwarded-For
113 server server1 localhost:81 weight 1 maxconn 1024 check
115 backend socket_backend
117 option forwardfor # This sets X-Forwarded-For
120 timeout server 86400000
122 server server1 localhost:82 weight 1 maxconn 2048 check