Changing the fetch for virtual hosts.

Per Buer perbu at varnish-software.com
Fri Feb 4 18:12:14 CET 2011


On Fri, Feb 4, 2011 at 5:17 PM, Chris Johnson
<johnson at nmr.mgh.harvard.edu> wrote:
> On Fri, 4 Feb 2011, Per Buer wrote:
>>
>>      if (req.http.host ~ "^www.example.com") {
>>        set req.backend = foo;
>>      }
>
>     Which goes in vcl_recv and in his case foo is a backend declaration
> function that sets up .host and .port for the virtual host I want, yes?

Almost. foo is here a declared backend - declared with the keyword
"backend" - http://www.varnish-cache.org/docs/trunk/tutorial/backend_servers.html





-- 
Per Buer, Varnish Software
Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer
Varnish makes websites fly!
Want to learn more about Varnish? http://www.varnish-software.com/whitepapers




More information about the varnish-misc mailing list