1

How can I test if a cookie starts with SESS* in the Varnish config file. I want all requests to hit the server if this cookie is set. Is it a regular regex?

1 Answer 1

2

Yeah, just use a regex in vcl_recv. Something like:

if (req.http.Cookie ~ "(^|;\s*)SESS") {
    return(pass);
}
2
  • I already have something like: if (req.http.Cookie ~ "(VARNISH|DRUPAL_UID)") { return (pass); }. Should I just add this afterwards? Jul 25, 2012 at 21:11
  • Yeah that'll work.
    – Pax
    Jul 26, 2012 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .