Created
September 22, 2012 19:14
-
-
Save lackac/3767467 to your computer and use it in GitHub Desktop.
HAProxy configuration with Websocket support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
maxconn 4096 # Total Max Connections. This is dependent on ulimit | |
nbproc 2 | |
log 127.0.0.1 local1 notice | |
defaults | |
mode http | |
log global | |
frontend all 0.0.0.0:80 | |
timeout client 86400000 | |
default_backend www_backend | |
acl is_websocket hdr(Upgrade) -i WebSocket | |
acl is_websocket hdr_beg(Host) -i ws | |
acl host_bibliaolvaso hdr_sub(Host) -i bibliaolvaso.hu | |
acl host_todomvc hdr_sub(Host) -i todomvc | |
use_backend bibliaolvaso_backend if is_websocket host_bibliaolvaso | |
use_backend todomvc_backend if is_websocket host_todomvc | |
backend www_backend | |
balance roundrobin | |
option forwardfor # This sets X-Forwarded-For | |
timeout server 86400000 | |
timeout connect 4000 | |
server nginx localhost:81 | |
backend bibliaolvaso_backend | |
balance roundrobin | |
option forwardfor # This sets X-Forwarded-For | |
timeout queue 5000 | |
timeout server 86400000 | |
timeout connect 5000 | |
server bibliaolvaso localhost:7777 | |
backend todomvc_backend | |
balance roundrobin | |
option forwardfor # This sets X-Forwarded-For | |
timeout queue 5000 | |
timeout server 86400000 | |
timeout connect 5000 | |
server todomvc localhost:3003 |
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
Still useful 8 years later. Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@indrajeet0510 lmfao