3 ms·
I used (and modified) one based on Dreamhost's https://github.com/dreamhost/varnish-vcl-collection/blob/master/wordpress-example.vcl https://github.com/dreamhos
by lstamour 12y ago
I used (and modified) one based on Dreamhost's https://github.com/dreamhost/varnish-vcl-collection/blob/master/wordpress-example.vcl https://github.com/dreamhost/varnish-vcl-collection/blob/mas... but there's a bunch of others on Github if you search for them. Note that this isn't a shortcut so you don't have to learn VCL... and that the way I did it was to put Varnish on port 80 and the web server on another port. I've seen other configs where a load balancer asks Varnish when it knows varnish should have the answer and otherwise sends traffic directly to the web server. And sometimes your config will vary based on asset type or domain name -- e.g. static.example.org assets might be cacheable forever while your site's pages might only require a 2 minute cache. You can invalidate cached-forever pages with commands for Varnish or by varying the URL using a "cache buster" hash or string in the asset filename. Oh and don't forget to set the storage type Varnish uses to malloc instead of file.
- sandGorgon 12y agothanks for this ! I guess you dont have an SSL termination point in front. What I was thinking of was nginx -> varnish -> nginx.
- lstamour 12y agoAh, actually we do, but that runs on the load balancer. We currently use nginx on the LB but you could use haproxy alone these days.
- sandGorgon 12y agoWhen you use nginx as ssl termination loadbalancer - do you just do a proxy forward to varnish, or is it anything complicated ?