Steps to configure HAProxy with Varnish and CDN

I am planning implement CLIENT - HAPROXY - VARNISH - APPSERVER set up to load balance an E-Commerce web site and the web site has lots of static content. I need help to configure HAPROXY to balance load and also to divert request based on Static and Dynamic content. Static should go to Varnish Cache server and Dynamic to the web servers.

Second requirement is to use CDN also. Is it possible to use Varnish and CDN to gather in HAPROXY and also please recommend any additional settings I have to take care for setting up a E-Commerce site