varnish backend redirection based on url

Sandro guly Zaccarini guly at luv.guly.org
Wed Aug 3 19:58:11 CEST 2011


On Wed, Aug 03, 2011 at 09:59:54PM +0530, Shibashish wrote:
> This doesn't work...
> 
>   if (req.http.host == "www.domain.com" && req.url  ~ "^/hi$") {
>        set req.backend = hiserver; }
>    elseif (req.http.host == "www.domain.com" && req.url  ~ "^/$") {
>         # if /hi is not specified, i.e go to /
>        set req.backend = enserver; }
>    else  {set req.backend = default; }                                   #
> all other sites go here


look: you are checking for /hi / everythingelse
if uri is /hi/ it doesn't match anything so it fallback to last else

not sure if you want to match /hi or /hi/..but i think that could be
part of the issue.

sz
-- 
  /"\   taste your favourite IT consultant
  \ /   gpg public key http://www.guly.org/guly.asc
   X    
  / \   





More information about the varnish-misc mailing list