15 ms·
Having Nginx in front is a lot more flexible that just having HAProxy listen on port 80. For example, it can serve static files and do redirects both of which d
by brett 17y ago
Having Nginx in front is a lot more flexible that just having HAProxy listen on port 80. For example, it can serve static files and do redirects both of which don't need to pass through the whole load balanced stack.
They could use Nginx -> HAProxy -> Nginx(w/ passenger), but the Apache version feels slightly more mature (e.g. it has some config options that the Nginx version lacks) and it's likely they were already using it before the Nginx version came out.
- zepolen 17y agoWhy use HAProxy at all?
- lacerus 17y agoThere is an interesting "Zero-Downtime Restarts with HAProxy" Tutorial that he might have implemented: http://www.igvita.com/2008/12/02/zero-downtime-restarts-with-haproxy/ http://www.igvita.com/2008/12/02/zero-downtime-restarts-with...
- brett 17y agoIt's better at load balancing. For example it handles app servers that have gone down more gracefully. Also it generates an awesome stats page that gives you way more info about what's going on than you can get from Nginx.
- caseyf 17y agoYep! We used nginx's fair balancing module before switching to haproxy. It also helps me do rolling restarts/hot deployments in a nice way. It's really a great piece of software. Kudos to Willy. PS - you're also correct about the nginx->haproxy->apache. nginx makes a fabulous front end and I just plugged in Apache/Passenger where Mongrel used to be. I like that 1) I can easily plug in something else in the future and 2) Passenger on Apache is very stable. Nginx support is newish and I'm running stripped down Apaches that only do Passenger, so I'm not too fussed about it.