Created
November 9, 2011 12:44
-
-
Save dudemeister/1351331 to your computer and use it in GitHub Desktop.
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 | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you're googling this, it doesn't work