Varnish not respecting pass to backend for specified http hosts

Stephen Reese rsreese at gmail.com
Tue Mar 31 22:54:52 UTC 2020


On Tue, Mar 31, 2020 at 6:06 PM Dridi Boukelmoune <dridi at varni.sh> wrote:
> > if ((req.http.host ~ "(domain.com) || (dev.domain.com)")) {
>
> No matter how you look at it this if statement is broken.
>
> You can either go for this:
>
> > if (req.http.host ~ "^(dev\.)?domain\.com")
>
> Or you can do this:
>
> > if (req.http.host == "domain.com" || req.http.host == "dev.domain.com")
>
> The ~ operator in this context matches regular expressions, and your
> regex doesn't make sense.

Thanks for clearing this up!


More information about the varnish-misc mailing list