Commit 2c503de0 authored by Petter Knudsen's avatar Petter Knudsen

Updated the man page for vcl to include the default bin/varnishd/default.vcl...

Updated the man page for vcl to include the default bin/varnishd/default.vcl so it is easier kept in sync. Same goes for etc/default.vcl, which now is generated from the same bin/varnishd/default.vcl.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3065 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent b607a6ef
# $Id$
EXTRA_DIST = default.vcl zope-plone.vcl
EXTRA_DIST = zope-plone.vcl
dist_data_DATA = default.vcl
default.vcl:
echo -e "This is a basic VCL configuration file for varnish. See the vcl(7)\n\
man page for details on VCL syntax and semantics.\n\
\n\
Default backend definition. Set this to point to your content\n\
server.\n\
\n\
backend default {\n\
.host = "127.0.0.1";\n\
.port = "8080";\n\
}\n\
\n\
Below is a commented-out copy of the default VCL logic. If you\n\
redefine any of these subroutines, the built-in logic will be\n\
appended to your code.\n" > tmp.vcl
sed -n '/vcl_recv/,$$p' ../bin/varnishd/default.vcl >> tmp.vcl
sed 's/^\(.*\)$$/#\1/' tmp.vcl > default.vcl
rm tmp.vcl
#
# This is a basic VCL configuration file for varnish. 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.
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Below is a commented-out copy of the default VCL logic. If you
# redefine any of these subroutines, the built-in logic will be
# appended to your code.
## Called when a client request is received
#
#sub vcl_recv {
# if (req.request != "GET" &&
# req.request != "HEAD" &&
# req.request != "PUT" &&
# req.request != "POST" &&
# req.request != "TRACE" &&
# req.request != "OPTIONS" &&
# req.request != "DELETE") {
# pipe;
# }
# if (req.http.Expect) {
# pipe;
# }
# if (req.request != "GET" && req.request != "HEAD") {
# pass;
# }
# if (req.http.Authorization || req.http.Cookie) {
# pass;
# }
# lookup;
#}
#
## Called when entering pipe mode
#
#sub vcl_pipe {
# pipe;
#}
#
## Called when entering pass mode
#
#sub vcl_pass {
# pass;
#}
#
## Called when entering an object into the cache
#
#sub vcl_hash {
# set req.hash += req.url;
# if (req.http.host) {
# set req.hash += req.http.host;
# } else {
# set req.hash += server.ip;
# }
# hash;
#}
#
## Called when the requested object was found in the cache
#
#sub vcl_hit {
# if (!obj.cacheable) {
# pass;
# }
# deliver;
#}
#
## Called when the requested object was not found in the cache
#
#sub vcl_miss {
# fetch;
#}
#
## Called when the requested object has been retrieved from the
## backend, or the request to the backend has failed
#
#sub vcl_fetch {
# if (!obj.valid) {
# error obj.status;
# }
# if (!obj.cacheable) {
# pass;
# }
# if (obj.http.Set-Cookie) {
# pass;
# }
# set obj.prefetch = -30s; insert;
#}
#
## Called before a cached object is delivered to the client
#
#sub vcl_deliver {
# deliver;
#}
#
## Called when an object nears its expiry time
#
#sub vcl_timeout {
# discard;
#}
#
# Called when an object is about to be discarded
#
#sub vcl_discard {
# discard;
#}
# $Id$
dist_man_MANS = vcl.7
vcl.7: vcl.7so default.vcl
soelim $< > $@
default.vcl: ../bin/varnishd/default.vcl
sed -n '/vcl_recv/,$$w $@' $<
......@@ -506,81 +506,7 @@ backend default {
set backend.port = "http";
}
sub vcl_recv {
if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
pipe;
}
if (req.http.Expect) {
pipe;
}
if (req.request != "GET" && req.request != "HEAD") {
pass;
}
if (req.http.Authorization || req.http.Cookie) {
pass;
}
lookup;
}
sub vcl_pipe {
pipe;
}
sub vcl_pass {
pass;
}
sub vcl_hash {
set req.hash += req.url;
if (req.http.host) {
set req.hash += req.http.host;
} else {
set req.hash += server.ip;
}
hash;
}
sub vcl_hit {
if (!obj.cacheable) {
pass;
}
deliver;
}
sub vcl_miss {
fetch;
}
sub vcl_fetch {
if (!obj.valid) {
error obj.status;
}
if (!obj.cacheable) {
pass;
}
if (obj.http.Set-Cookie) {
pass;
}
set obj.prefetch = -30s; insert;
}
sub vcl_deliver {
deliver;
}
sub vcl_discard {
discard;
}
sub vcl_timeout {
discard;
}
.so default.vcl
.Ed
.Pp
The following example shows how to support multiple sites running on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment