How to match domains starting with "admin"

Paul A. Procacci pprocacci at datapipe.com
Mon Jul 9 22:20:01 CEST 2012


On Mon, Jul 09, 2012 at 10:09:15PM +0200, Javier Casares wrote:
> Is not easy...
>
> if (req.http.host ~ "domain1" || req.http.host ~ "domain2") {
>   set req.backend = domain1_domain2;
> }
>
> or something like this? I use this and works fine to me.
>

This is close.  Though, if your prefixes, and TLD are different,
as well as the domain name, I'd personally use an exact match
operator and not a regex operator:

if(req.http.host = "domain1" || req.http.host = "domain2") {
  set req.backend = domain1_domain2;
}

________________________________

This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you.



More information about the varnish-misc mailing list