global
maxconn 4096
defaults
mode http
balance roundrobin
option redispatch
option forwardfor
timeout connect 5s
timeout queue 5s
timeout client 50s
timeout server 50s
listen stats
bind *:1936
mode http
stats enable
stats uri /stats
stats auth guest:guest
stats refresh 5s
frontend http-in
bind *:8000
# check request ws acl
acl backend_ws path_beg /socket.io
acl backend_ws hdr(Upgrade) -i webSocket
acl backend_ws hdr_beg(Host) -i ws
# if it is ws request , use websockets
use_backend websockets if is_websocket
# if it is http request, use webservers
default_backend servers
backend servers # web server
server server1 [address]:[port] check
#example
#server server1 172.17.0.10:8080 check
backend websockets # socket server
balance source # if use balance to roundrobin, you have to use stick option
option http-server-close
option forceclose
server ws-server1 [address]:[port] maxconn 30000 weight 1 maxconn 1024 check
#example
#server ws-server1 172.17.0.1:80 maxconn 30000 weight 1 maxconn 1024 check
#server ws-server2 172.17.0.2:80 maxconn 30000 weight 1 maxconn 1024 check
#server ws-server3 172.17.0.3:80 maxconn 30000 weight 1 maxconn 1024 check
댓글을 달아 주세요