<div class="gmail_quote">On Wed, Aug 3, 2011 at 11:28 PM, Sandro guly Zaccarini <span dir="ltr"><<a href="mailto:guly@luv.guly.org">guly@luv.guly.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Aug 03, 2011 at 09:59:54PM +0530, Shibashish wrote:<br>
> This doesn't work...<br>
><br>
> if (req.http.host == "<a href="http://www.domain.com" target="_blank">www.domain.com</a>" && req.url ~ "^/hi$") {<br>
> set req.backend = hiserver; }<br>
> elseif (req.http.host == "<a href="http://www.domain.com" target="_blank">www.domain.com</a>" && req.url ~ "^/$") {<br>
> # if /hi is not specified, i.e go to /<br>
> set req.backend = enserver; }<br>
> else {set req.backend = default; } #<br>
> all other sites go here<br>
<br>
<br>
</div>look: you are checking for /hi / everythingelse<br>
if uri is /hi/ it doesn't match anything so it fallback to last else<br>
<br>
not sure if you want to match /hi or /hi/..but i think that could be<br>
part of the issue.<br>
<br>
sz<br>
--<br>
/"\ taste your favourite IT consultant<br>
\ / gpg public key <a href="http://www.guly.org/guly.asc" target="_blank">http://www.guly.org/guly.asc</a><br>
X<br>
/ \<br><br></blockquote><div>Good pointers... finally got this to work...</div><div><br></div><div> if (req.http.host ~ "<a href="http://www.domain.com">www.domain.com</a>" && !req.url ~ "^/hi/|^/hi") {</div>
<div> set req.backend = enserver; }</div><div> elseif (req.http.host ~ "<a href="http://www.domain.com">www.domain.com</a>" && req.url ~ "^/hi/|^/hi") {</div><div> set req.backend = hiserver; }</div>
<div> else {set req.backend = default;}</div><div> </div><div>Thanks a ton.</div><div><br clear="all">ShiB.<br>while ( ! ( succeed = try() ) );<br></div></div>