2013-03-17 10:28:26 -07:00
|
|
|
global
|
2013-05-01 13:22:03 -07:00
|
|
|
maxconn 10000
|
2013-03-17 10:28:26 -07:00
|
|
|
user haproxy
|
|
|
|
group haproxy
|
|
|
|
daemon
|
|
|
|
ca-base /srv/newsblur/config/certificates
|
|
|
|
crt-base /srv/newsblur/config/certificates
|
2013-03-17 12:39:05 -07:00
|
|
|
log 127.0.0.1 local0 notice
|
2013-03-18 11:32:24 -07:00
|
|
|
# log 127.0.0.1 local1 info
|
2013-03-17 10:28:26 -07:00
|
|
|
|
|
|
|
defaults
|
|
|
|
log global
|
2013-05-01 13:22:03 -07:00
|
|
|
maxconn 10000
|
2013-03-17 10:28:26 -07:00
|
|
|
mode http
|
2013-05-01 13:22:03 -07:00
|
|
|
option forwardfor header X-Real-IP
|
2013-03-17 10:28:26 -07:00
|
|
|
option http-server-close
|
2013-03-17 12:39:05 -07:00
|
|
|
option log-health-checks
|
2013-03-17 11:25:16 -07:00
|
|
|
option httplog
|
|
|
|
option redispatch
|
2013-03-17 14:06:17 -07:00
|
|
|
option abortonclose
|
2013-03-17 10:28:26 -07:00
|
|
|
timeout connect 5s
|
|
|
|
timeout client 30s
|
|
|
|
timeout server 30s
|
|
|
|
timeout tunnel 1h
|
2013-03-17 12:39:05 -07:00
|
|
|
retries 3
|
2013-03-17 14:06:17 -07:00
|
|
|
errorfile 502 /srv/newsblur/templates/502.http
|
2013-03-17 12:39:05 -07:00
|
|
|
errorfile 503 /srv/newsblur/templates/502.http
|
|
|
|
errorfile 504 /srv/newsblur/templates/502.http
|
2013-03-18 11:32:24 -07:00
|
|
|
|
2013-03-17 10:28:26 -07:00
|
|
|
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 }
|
|
|
|
|
2013-03-17 14:06:17 -07:00
|
|
|
acl gunicorn_dead nbsrv(gunicorn) lt 1
|
|
|
|
acl nginx_dead nbsrv(nginx) lt 1
|
|
|
|
acl mx_mode nbsrv(maintenance) lt 1
|
|
|
|
monitor-uri /status
|
|
|
|
monitor fail if gunicorn_dead
|
|
|
|
monitor fail if nginx_dead
|
|
|
|
monitor fail if mx_mode
|
2013-03-17 12:39:05 -07:00
|
|
|
|
2013-03-17 10:28:26 -07:00
|
|
|
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/ }
|
2013-03-17 14:06:17 -07:00
|
|
|
use_backend nginx if { path_beg /favicon }
|
2013-03-17 11:25:16 -07:00
|
|
|
use_backend nginx if { path_beg /crossdomain/ }
|
2013-03-17 14:06:17 -07:00
|
|
|
use_backend nginx if { path_beg /robots }
|
2013-03-17 11:25:16 -07:00
|
|
|
use_backend nginx if { path_beg /munin/ }
|
|
|
|
use_backend nginx if { path_beg /rss_feeds/icon }
|
|
|
|
|
2013-03-17 14:06:17 -07:00
|
|
|
use_backend nginx if mx_mode
|
|
|
|
|
|
|
|
use_backend gunicorn unless gunicorn_dead || nginx_dead
|
2013-03-17 10:28:26 -07:00
|
|
|
|
|
|
|
backend node
|
|
|
|
balance roundrobin
|
2013-05-01 13:22:03 -07:00
|
|
|
server nodedebug 127.0.0.1:8888 check inter 2000ms
|
2013-03-18 11:32:24 -07:00
|
|
|
|
2013-03-17 11:25:16 -07:00
|
|
|
|
2013-03-17 10:28:26 -07:00
|
|
|
backend nginx
|
|
|
|
balance roundrobin
|
2013-05-01 13:22:03 -07:00
|
|
|
server nginxdebug 127.0.0.1:81 check inter 2000ms
|
2013-03-17 10:28:26 -07:00
|
|
|
|
2013-03-17 11:25:16 -07:00
|
|
|
backend gunicorn
|
|
|
|
balance roundrobin
|
2013-05-01 13:22:03 -07:00
|
|
|
server gunicorndebug 127.0.0.1:8000 check inter 2000ms
|
2013-03-17 11:25:16 -07:00
|
|
|
|
2013-03-17 14:06:17 -07:00
|
|
|
backend maintenance
|
|
|
|
option httpchk HEAD /maintenance HTTP/1.1\r\nHost:\ www
|
|
|
|
http-check expect status 404
|
|
|
|
http-check send-state
|
2013-03-18 11:32:24 -07:00
|
|
|
server nginx10 198.211.109.197:81 check inter 2000ms
|
2013-03-17 14:06:17 -07:00
|
|
|
|
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 /
|
2013-03-17 12:39:05 -07:00
|
|
|
stats auth sclay:password
|
2013-03-18 11:32:24 -07:00
|
|
|
stats refresh 15s
|