Skip to content

Instantly share code, notes, and snippets.

@asabirov
Created September 21, 2011 16:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save asabirov/1232497 to your computer and use it in GitHub Desktop.
Save asabirov/1232497 to your computer and use it in GitHub Desktop.
Nginx, Faye, Node.js on 80 port
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
nbproc 1
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
defaults
mode http
option forwardfor
option httpclose
frontend all 85.17.162.170:80
timeout client 86400000
acl is_faye url_sub faye
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
use_backend faye_backend if is_faye
use_backend ws_backend if is_websocket
default_backend nginx_backend
backend ws_backend
timeout queue 5000
timeout connect 86400000
timeout server 86400000
server server1 85.17.162.170:9696 maxconn 2000 check
backend faye_backend
timeout connect 4000
timeout server 30000
server server1 85.17.162.170:9696 maxconn 2000 check
backend nginx_backend
timeout connect 400
timeout server 600
server server1 85.17.162.170:8081 maxconn 2000 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment