Hacker News new | ask | show | jobs
by chr15 4900 days ago
Can anyone compare Nginx and HAProxy, and also provide an example of using both in an infrastructure?
2 comments

Here or in an article? We use both in our infrastructure.

Generally I would say that if you're proxying web connections and need caching or the ability to do lots of complicated rewriting on the proxy side, use nginx. If you're proxying database, mail or similar... haproxy. If you don't need any caching or similar, either nginx or haproxy depending on your application.

I'm not terribly experienced with Nginx, but HAProxy was (and is) a load balancer first where Nginx is a server with load balancing abilities (same as Apache can, though it gets less love these days). HAProxy has pretty powerful HTTP support and capabilities, however, so I'm not sure I buy the other argument in this thread.

HAProxy also allows you to modify balanced nodes while the server is running, and has fantastic logging once you get used to looking at it.