could you describe how you got this working? i need something similar
to make sure that a django app doesn’t die.
I assume that you are modifing a working nginx/django configuration.
Mine is a zope server. For static content I go to varnish and for the
rest
I use proxy_pass to go to zope. I inserted haproxy in front of zope.
nginx -> varnish -> haproxy -> zope
nginx ------------> haproxy -> zope
nginx is on port 80
varnish is on port 8082
zope is on port 8081
haproxy is on port 8085
#------------------------------------------------------------
nginx server configuration…
upstream varnish1 {
server 127.0.0.1:8082;
}
upstream haproxy {
server 127.0.0.1:8085;
}
#------------------------------------------------------------
haproxy configuration…
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
user haproxy
group haproxy
daemon
# enable debug to run in the foreground
debug
defaults
mode http
retries 100
option redispatch
timeout connect 60s
# I have some very slow requests - generate 1000's of emails,
printouts
timeout queue 300s
timeout client 1200s
timeout server 1200s
# this is just monitoring stuff
monitor-uri /haproxy-ping
stats enable
stats uri /haproxy-status
stats refresh 5s
stats realm Haproxy statistics
listen zope3 0.0.0.0:8085
dispatch 127.0.0.1:8081 maxcon 3
#------------------------------------------------------------
Install haproxy…
$ apt-get install haproxy
edit /etc/default/haproxy and enable it
$ /etc/init.d/haproxy start
Regards,
Kevin