I have multiple subdomains pointing to one varnish instance. I read in the 
documentation that PCRE regex should be used. I believe the regex I have below 
should return true when the request url is “http://internal.my.com/any/thing 
<http://internal.my.com/any/thing>” and the 15s ttl should be set. I’ve tried 
just (req.url ~ “internal.my.com <http://internal.my.com/>”) as well because I 
read that it should match if any part of the request url. Help is appreciated! 
Thanks!

-Ryan

# Cache for a longer time if the internal.my.com URL isn't used
sub vcl_fetch {
  if (req.url ~ "^[(http:\/\/)|(https:\/\/)]*internal\.my\.com.*"){
    set beresp.ttl = 15 s;
  } else {
    set beresp.ttl = 300 s;
  }
}
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to