Skip to content

Instantly share code, notes, and snippets.

@dudemeister
Created November 9, 2011 12:44
Show Gist options
  • Save dudemeister/1351331 to your computer and use it in GitHub Desktop.
Save dudemeister/1351331 to your computer and use it in GitHub Desktop.
global
maxconn 4096
# user haproxy
# group haproxy
debug
defaults
timeout client 60000
timeout server 30000
timeout connect 4000
frontend http *:80
mode http
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 app_ws if is_websocket
default_backend app
backend app_ws
mode http
option http-pretend-keepalive
server app_ws_1 127.0.0.1:5001 check
backend app
mode http
server app_1 127.0.0.1:81 check
frontend https *:443
mode tcp
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 app_ws_https if is_websocket
default_backend app_https
backend app_ws_https
mode tcp
option http-pretend-keepalive
server app_ws_https_1 127.0.0.1:5002 check
backend app_https
mode tcp
server app_https_1 127.0.0.1:444 check
@dudemeister
Copy link
Author

if you're googling this, it doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment