Skip to content

Commit

Permalink
modified varnish config to allow post/page previews
Browse files Browse the repository at this point in the history
  • Loading branch information
okor committed Sep 28, 2012
1 parent 13491da commit 950f22e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions configs/default.vcl
Expand Up @@ -2,16 +2,19 @@ backend default {
.host = "127.0.0.1";
.port = "8080";
}

# Drop any cookies sent to Wordpress.
# except when previewing
sub vcl_recv {
if (!(req.url ~ "wp-(login|admin)")) {
if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
unset req.http.cookie;
}
}

# Drop any cookies Wordpress tries to send back to the client.
# except when previewing
sub vcl_fetch {
if (!(req.url ~ "wp-(login|admin)")) {
if ( !(req.url ~ "(wp-login|wp-admin|preview=true)") ) {
unset beresp.http.set-cookie;
}
}

0 comments on commit 950f22e

Please sign in to comment.