back end not selected in vcl

Per Buer perbu at varnish-software.com
Sun Nov 9 10:40:22 CET 2014


Hi Tim,



On Sun, Nov 9, 2014 at 5:12 AM, Tim Dunphy <bluethundr at gmail.com> wrote:

> Hey all,
>
>  I tried to add my wiki host to my VCL in the hopes of giving it a little
> speed boost.
>
>  However it seems that when I put the vcl into place and cycling varnish
> that the 'wiki' back end is never selected. My main website gets pulled up
> in the browser when I enter in the wiki URL.
>
> Can someone maybe take a look and let me know what I'm doing wrong in my
> VCL logic?
>
>     if ( req.url ~ "wiki.mydomain.com") {
>
>         set req.backend = www;
>

There are two mistakes here it seems. Firstly req.url contains the URL part
without the host. The host is in req.http.host. Furthermore I think you
meant !~ here.

So what you want is

 if (req.http.host ≈ "wiki.mydomain.com") {
      set req.backend = wiki;
 }


Per.

-- 
*Per Buer*
CTO | Varnish Software AS
Cell: +47 95839117
We Make Websites Fly!
www.varnish-software.com
[image: Register now]
<http://info.varnish-software.com/varnish-summits-autumn-2014-registration>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20141109/2f685ef0/attachment.html>


More information about the varnish-misc mailing list