Please note Varnish allows virtually endless configuration options, and the proxy directives below may need certain customization to work with your particular setup. You should always test your configuration to ensure it works properly before adding it to your production servers.
Yavli staff is always happy to help you integrate Proxy handling in Varnish. You may send us your existing Varnish configuration file, and we will implement the proxy directives in it for you.
Typically this file is located here:
/etc/varnish/default.vcl
This should be placed after your existing backend declarations, usually in the beginning of the configuration file.
backend yavli { .host = "steg.yavli.com"; .port = "80"; }
This should be placed inside the vcl_backend_response section. Note this is in addition to what you already may have in there.
sub vcl_backend_response { if (bereq.url ~ ".*\.(?:png|jpg|gif)$" && beresp.status == 404 && bereq.retries == 0) { set bereq.backend = yavli; return(retry); } }
How Varnish is restarted varies from platform to platform. On Ubuntu, it is typically done like this:
service varnish restart