Can anyone compare Nginx and HAProxy, and also provide an example of using both in an 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.
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.