varnish - Regex to match host request -
given vcl code in varnish 3.0.2:
sub vcl_recv { if (req.http.host !~ "^(?i)(www|m|mobile)\.example\.com$" || req.http.host !~ "^(?i)example\.com$") { error 403 "forbidden"; } return(lookup); } can explain why i'm getting 403s on "www.example.com"?
thanks
i don't know varnish , syntax, interpret || logical or. www.example.com not match second alternative ==> true , enter if.
probably wanted logical and? if both not true, 403?
so try:
if (req.http.host !~ "^(?i)(www|m|mobile)\.example\.com$" && req.http.host !~ "^(?i)example\.com$") { error 403 "forbidden"; }
Comments
Post a Comment