Skip to content

Instantly share code, notes, and snippets.

@yuri-ko
Created October 18, 2010 14:30
Show Gist options
  • Save yuri-ko/632300 to your computer and use it in GitHub Desktop.
Save yuri-ko/632300 to your computer and use it in GitHub Desktop.
haproxy config to work with miksago's node-websocket-server
global
maxconn 4096
user haproxy
group haproxy
debug
defaults
timeout client 60000
timeout server 30000
timeout connect 4000
frontend http_in
mode http
bind *:80
option http-server-close
acl is_websocket hdr(Upgrade) -i WebSocket #check the Upgrade header
acl is_websocket hdr_beg(Host) -i ws #also check the host
use_backend node_ws if is_websocket
default_backend nginx_static
backend node_ws
mode http
option http-pretend-keepalive
server node_ws_1 127.0.0.1:8585 check
backend nginx_static
mode http
server nginx_static_1 127.0.0.1:8000 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment