i have varnish installed that serve my cached content on my sites i have wordpress and added the rule to strip incoming and outgoing cookies if they do not belong to wp-admin or wp-login
sub vcl_recv {
if (!(req.url ~ "wp-(login|admin)")) {
unset req.http.cookie;
}
}
and
sub vcl_fetch {
if (!(req.url ~ "wp-(login|admin)") {
unset beresp.http.set-cookie;
}
}
now i added some other sites on different domains/subdomains that need to have cookies enabled; i tried to add the rule but with no success, the only way i solved is without caching some domain/subdomains.
i was thinking something like (both for recv and fetch) but it doesn't work, and it breks the wordpress rule too:
sub vcl_fetch {
if (!(req.url ~ "wp-(login|admin)") || !(req.http.host ~ "ingredienti\.popeating\.it")) {
unset beresp.http.set-cookie;
}
}