Hi,<br><br>I have to work with a lot of domain names in my varnish config and I was wondering if there is an easier to way to match the hostname other than a series of if statements. Is there anything like a hash? Or does anybody have any C code to do this?<br>
<br>example pseudo code:<br>=================================<br>vcl_recv(){<br><br> if(req.http.host == "<a href="http://www.domain1.com">www.domain1.com</a>")<br> {<br> set req.backend = www_domain1_com;<br>
# more code<br> return(lookup);<br> }<br> if(req.http.host == "<a href="http://www.domain2.com">www.domain2.com</a>")<br> {<br> set req.backend = www_domain2_com;<br> # more code<br>
return(lookup);<br> }<br> if(req.http.host == "<a href="http://www.domain3.com">www.domain3.com</a>")<br> {<br> set req.backend = www_domain3_com;<br> # more code<br> return(lookup);<br>
}<br>}<br>=================================<br><br>Thank you,<br>Paul<br>