On Wed, Aug 3, 2011 at 11:28 PM, Sandro guly Zaccarini <[email protected]>wrote:
> 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
> / \
>
> Good pointers... finally got this to work...
if (req.http.host ~ "www.domain.com" && !req.url ~ "^/hi/|^/hi") {
set req.backend = enserver; }
elseif (req.http.host ~ "www.domain.com" && req.url ~ "^/hi/|^/hi") {
set req.backend = hiserver; }
else {set req.backend = default;}
Thanks a ton.
ShiB.
while ( ! ( succeed = try() ) );
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc