2013-03-17 10:28:26 -07:00
|
|
|
global
|
|
|
|
maxconn 4096
|
|
|
|
user haproxy
|
|
|
|
group haproxy
|
|
|
|
daemon
|
|
|
|
ca-base /srv/newsblur/config/certificates
|
|
|
|
crt-base /srv/newsblur/config/certificates
|
|
|
|
|
|
|
|
defaults
|
|
|
|
log global
|
|
|
|
maxconn 4096
|
|
|
|
mode http
|
|
|
|
# Add x-forwarded-for header.
|
|
|
|
option forwardfor
|
|
|
|
option http-server-close
|
2013-03-17 11:25:16 -07:00
|
|
|
option httplog
|
|
|
|
option redispatch
|
2013-03-17 10:28:26 -07:00
|
|
|
timeout connect 5s
|
|
|
|
timeout client 30s
|
|
|
|
timeout server 30s
|
|
|
|
# Long timeout for WebSocket connections.
|
|
|
|
timeout tunnel 1h
|
|
|
|
errorfile 503 /srv/newsblur/templates/502.html
|
|
|
|
errorfile 504 /srv/newsblur/templates/502.html
|
|
|
|
|
|
|
|
frontend public
|
|
|
|
bind :80
|
|
|
|
bind :443 ssl crt newsblur.pem
|
2013-03-17 11:25:16 -07:00
|
|
|
option http-server-close
|
2013-03-17 10:28:26 -07:00
|
|
|
# Redirect all HTTP traffic to HTTPS
|
|
|
|
# redirect scheme https if !{ ssl_fc }
|
|
|
|
|
|
|
|
use_backend node if { path_beg /socket.io/ }
|
2013-03-17 11:25:16 -07:00
|
|
|
use_backend nginx if { path_beg /media/ }
|
|
|
|
use_backend nginx if { path_beg /static/ }
|
|
|
|
use_backend nginx if { path_beg /favicon/ }
|
|
|
|
use_backend nginx if { path_beg /crossdomain/ }
|
|
|
|
use_backend nginx if { path_beg /robots/ }
|
|
|
|
use_backend nginx if { path_beg /munin/ }
|
|
|
|
use_backend nginx if { path_beg /rss_feeds/icon }
|
|
|
|
|
|
|
|
default_backend gunicorn
|
2013-03-17 10:28:26 -07:00
|
|
|
|
|
|
|
backend node
|
|
|
|
balance roundrobin
|
|
|
|
server nodedebug 127.0.0.1:8888 check inter 500ms
|
2013-03-17 11:25:16 -07:00
|
|
|
|
2013-03-17 10:28:26 -07:00
|
|
|
backend nginx
|
|
|
|
balance roundrobin
|
|
|
|
server nginxdebug 127.0.0.1:81 check inter 500ms
|
|
|
|
|
2013-03-17 11:25:16 -07:00
|
|
|
backend gunicorn
|
|
|
|
balance roundrobin
|
|
|
|
server gunicorndebug 127.0.0.1:8000 check inter 500ms
|
|
|
|
|
2013-03-17 10:28:26 -07:00
|
|
|
frontend stats
|
|
|
|
bind :1936 ssl crt newsblur.pem
|
|
|
|
default_backend stats
|
|
|
|
|
|
|
|
backend stats
|
|
|
|
stats enable
|
|
|
|
stats hide-version
|
|
|
|
stats realm Haproxy\ Statistics
|
|
|
|
stats uri /
|
|
|
|
stats auth sclay:password
|