Created
January 24, 2012 17:46
-
-
Save ricardokrieg/1671470 to your computer and use it in GitHub Desktop.
HAProxy configuration file
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
frontend all 0.0.0.0:80 | |
mode tcp | |
maxconn 200000 | |
timeout client 86400000 | |
default_backend www_backend | |
acl is_socket_staging hdr_beg(host) socket.teste | |
acl is_socket hdr(Upgrade) -i WebSocket | |
acl is_socket hdr_beg(Host) -i ws | |
acl is_socket path /socket.io/socket.io.js | |
acl is_socket path_beg /socket.io | |
acl is_socket url_beg socket | |
acl is_app hdr_end(host) -i app.com.br | |
use_backend socket_app if is_socket is_app | |
tcp-request inspect-delay 500ms | |
tcp-request content accept if HTTP | |
use_backend socket_app_tcp if !HTTP is_app | |
# frontend | |
backend www_backend | |
mode http | |
option httplog | |
option httpclose | |
option forwardfor | |
balance roundrobin | |
timeout server 30000 | |
timeout connect 4000 | |
server nginx1 localhost:81 weight 1 maxconn 1024 check | |
# backend | |
backend socket_app | |
mode http | |
option httplog | |
option forwardfor | |
no option httpclose | |
option http-server-close | |
option forceclose | |
balance roundrobin | |
timeout check 1s | |
timeout queue 5000 | |
timeout server 86400000 | |
timeout connect 86400000 | |
server app_node1 localhost:8180 weight 1 maxconn 1024 check | |
# backend | |
backend socket_app_tcp | |
mode tcp | |
timeout server 86400000 | |
timeout connect 86400000 | |
server app_node2 localhost:8280 weight 1 maxconn 2000 check | |
# backend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment