On Mon, Jul 09, 2012 at 09:57:38AM -0700, Abraham Cruz Sustaita wrote:
>    I have several sites on my servers, so I need to configure one admin
>    subdomain for each one. However, I don't want to make:
>
>    if (req.http.Host ~
>    "(?i)([1]admin.domain1.com|[2]admin.domain2.com|[3]admin.domainN.com)?$
>    ") {}
>
>    Can I do this only with one regular expression of the type
>    (admin\.(.*)) ?
>

Something like the following will match anything prefix'd with `admin`.
You'd have to include the suffixes manually.  Luckily, there aren't too many
tld's for this to be a major concern.

^admin\.[^\.]+\.(?=(com|net|org))$

You can capture the entire hostname by including grouping operators
around the entire regex:

^(admin\.[^\.]+\.(com|net|org))$

~Paul

________________________________

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.

_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to