Created
January 6, 2015 01:05
-
-
Save owindsor/21b289d480d931d457c3 to your computer and use it in GitHub Desktop.
SilverStripe Varnish Cookie handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove all cookies that do not match the following rules | |
if ( | |
# Any HTTP POST request | |
!(req.request == "POST") && | |
# Admin URLs | |
!(req.url ~ "^/admin|Security/") && | |
# Allow /dev/build and /dev/tasks URLs | |
!(req.url ~ "dev/build/") && | |
!(req.url ~ "dev/tasks/") && | |
# Staging/Previewing URLs while in /admin | |
!(req.http.referer ~ "\?stage=Stage$/") && | |
!(req.http.referer ~ "\?stage=Live$/") | |
) | |
{ | |
unset req.http.Cookie; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment