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?
Asked
Active
Viewed 1,218 times
1

Eduard Luca
- 371
- 2
- 9
- 19
1 Answers
2
Yeah, just use a regex in vcl_recv. Something like:
if (req.http.Cookie ~ "(^|;\s*)SESS") {
return(pass);
}

Pax
- 335
- 2
- 8
-
I already have something like: `if (req.http.Cookie ~ "(VARNISH|DRUPAL_UID)") { return (pass); }`. Should I just add this afterwards? – Eduard Luca Jul 25 '12 at 21:11
-
Yeah that'll work. – Pax Jul 26 '12 at 13:58