[master] b0d9950 Remove Zope/Plone example VCL
Lasse Karstensen
lkarsten at varnish-software.com
Thu Jan 23 11:25:20 CET 2014
commit b0d9950b4151871877542ba28460f43bd243fd86
Author: Lasse Karstensen <lkarsten at varnish-software.com>
Date: Thu Jan 23 11:22:21 2014 +0100
Remove Zope/Plone example VCL
We don't have a maintainer for this, and it hasn't been updated for a while.
In general we use the Wiki for linking to or referencing backend-specific
configuration.
diff --git a/etc/zope-plone.vcl b/etc/zope-plone.vcl
deleted file mode 100644
index de599dd..0000000
--- a/etc/zope-plone.vcl
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# This is an example VCL configuration file for varnish, meant for the
-# Plone CMS running within Zope. It defines a "default" backend for
-# serving static content from a normal web server, and a "zope"
-# backend for requests to the Zope CMS
-#
-# See the vcl(7) man page for details on VCL syntax and semantics.
-#
-# $Id$
-#
-
-# Default backend definition. Set this to point to your content
-# server.
-
-# Default backend is the Zope CMS
-backend default {
- .host = "127.0.0.1";
- .port = "9673";
-}
-
-acl purge {
- "localhost";
- "192.0.2.0"/24;
-}
-
-sub vcl_recv {
-
- # Normalize host headers, and do rewriting for the zope sites. Reject
- # requests for unknown hosts
- if (req.http.host ~ "(www.)?example.com") {
- set req.http.host = "example.com";
- set req.url = "/VirtualHostBase/http/example.com:80/example.com/VirtualHostRoot" + req.url;
- } elsif (req.http.host ~ "(www.)?example.org") {
- set req.http.host = "example.org";
- set req.url = "/VirtualHostBase/http/example.org:80/example.org/VirtualHostRoot" + req.url;
- } else {
- error 404 "Unknown virtual host.";
- }
-
- # Handle special requests
- if (req.method != "GET" && req.method != "HEAD") {
-
- # POST - Logins and edits
- if (req.method == "POST") {
- return(pass);
- }
-
- # PURGE - The CacheFu product can invalidate updated URLs
- if (req.method == "PURGE") {
- if (!client.ip ~ purge) {
- error 405 "Not allowed.";
- }
- return(lookup);
- }
-
- # Do not cache the creation of objects in Plone
- if (req.url ~ "createObject"){
- return(pass);
- }
- }
-
- # Don't cache authenticated requests
- if (req.http.Cookie && req.http.Cookie ~ "__ac(|_(name|password|persistent))=") {
-
- # Force lookup of specific urls unlikely to need protection
- if (req.url ~ "\.(js|css|kss)") {
- remove req.http.cookie;
- return(lookup);
- }
- return(pass);
- }
-
- # The default vcl_recv is used from here.
- }
-
-# Do the PURGE thing
-sub vcl_hit {
- if (req.method == "PURGE") {
- purge;
- error 200 "Purged";
- }
-}
-sub vcl_miss {
- if (req.method == "PURGE") {
- purge;
- error 200 "Purged";
- }
-}
-
-# Enforce a minimum TTL, since we can PURGE changed objects actively
-# from Zope by using the CacheFu product
-
-sub vcl_response {
- if (beresp.ttl < 3600s) {
- set beresp.ttl = 3600s;
- }
-}
More information about the varnish-commit
mailing list