I have little experience in web site infrastructural architecture design. I know it might be situation specific. The web site is supposed to:
1) Need HTTPS support for some page (e.g. login page) while others are just HTTP page.
2) Need multiple web servers so that some load balancing is required.
3) Need HTTP caching and compression to boost performance.
4) Some requests (e.g. image uploading) should be routed to dedicated backend servers. So, URL-based balancing is required.
I know that NginX and HAProxy are both nice open-sourced Reverse Proxy and/or Load Balancer. Since HAProxy doesn't support SSL, while Nginx load balancing is not as good as HAProxy. I'll take both.
So, should I put Nginx (as reverse proxy) in the front of HAProxy (as load balancer), or opposite?