Haproxy with both Varnish and CDN

I am using HAProxy for routing static and dynamic content. We are using Varnish for local static caching and since the web application is expected to access globally we are planning to implement CDN along with Varnish.

Need help to configure HAProxy with both Varnish and CDN.