I'm in the process of doing my homework for a move from apache w/o caching to nginx with caching, possibly via varnish...
After reading various blogs, articles, serverfault questions, etc. I understand that varnish cannot work with ssl, and that varnish might be better than nginx for actual caching of dynamic content. But I'm a little stuck in understanding how nginx caching works AND how nginx+varnish can play together when ssl is required.
How would the following be implemented, with nginx+varnish OR just nginx with caching?
some urls driven by a custom php engine: i.e. example.com/this-page is served by example.com/index.php?p=this-page
some urls are driven by wordpress: i.e. example.com/blog/this-article is handled by wordpress via example.com/blog/index.php?p=this-article
should force ssl everywhere: i.e. http://example.com/* redirects to https://example.com/*
www should redirect to top domain: i.e. http://www.example.com/* redirects to https://example.com/*
All of which serving the cached version if it exists (if I understand- caching is time based, so if I make an update to that page, I need to call PURGE if the varnish route and manually delete files if the nginx route)