2
" * Copyright (c) 2006 Verdens Gang AS\n"
3
" * Copyright (c) 2006-2009 Linpro AS\n"
4
" * All rights reserved.\n"
6
" * Author: Poul-Henning Kamp <phk@phk.freebsd.dk>\n"
8
" * Redistribution and use in source and binary forms, with or without\n"
9
" * modification, are permitted provided that the following conditions\n"
11
" * 1. Redistributions of source code must retain the above copyright\n"
12
" * notice, this list of conditions and the following disclaimer.\n"
13
" * 2. Redistributions in binary form must reproduce the above copyright\n"
14
" * notice, this list of conditions and the following disclaimer in the\n"
15
" * documentation and/or other materials provided with the distribution.\n"
17
" * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n"
18
" * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n"
19
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n"
20
" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE\n"
21
" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n"
22
" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n"
23
" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \n"
24
" * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n"
25
" * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n"
26
" * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n"
27
" * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
29
" * $Id: default.vcl 5026 2010-07-06 12:06:03Z tfheen $\n"
31
" * The default VCL code.\n"
33
" * NB! You do NOT need to copy & paste all of these functions into your\n"
34
" * own vcl code, if you do not provide a definition of one of these\n"
35
" * functions, the compiler will automatically fall back to the default\n"
36
" * code from this file.\n"
38
" * This code will be prefixed with a backend declaration built from the\n"
43
" if (req.http.x-forwarded-for) {\n"
44
" set req.http.X-Forwarded-For =\n"
45
" req.http.X-Forwarded-For \", \" client.ip;\n"
47
" set req.http.X-Forwarded-For = client.ip;\n"
49
" if (req.request != \"GET\" &&\n"
50
" req.request != \"HEAD\" &&\n"
51
" req.request != \"PUT\" &&\n"
52
" req.request != \"POST\" &&\n"
53
" req.request != \"TRACE\" &&\n"
54
" req.request != \"OPTIONS\" &&\n"
55
" req.request != \"DELETE\") {\n"
56
" /* Non-RFC2616 or CONNECT which is weird. */\n"
59
" if (req.request != \"GET\" && req.request != \"HEAD\") {\n"
60
" /* We only deal with GET and HEAD by default */\n"
63
" if (req.http.Authorization || req.http.Cookie) {\n"
64
" /* Not cacheable by default */\n"
71
" # Note that only the first request to the backend will have\n"
72
" # X-Forwarded-For set. If you use X-Forwarded-For and want to\n"
73
" # have it set for all requests, make sure to have:\n"
74
" # set req.http.connection = \"close\";\n"
75
" # here. It is not set by default as it might break some broken web\n"
76
" # applications, like IIS with NTLM authentication.\n"
85
" set req.hash += req.url;\n"
86
" if (req.http.host) {\n"
87
" set req.hash += req.http.host;\n"
89
" set req.hash += server.ip;\n"
95
" if (!obj.cacheable) {\n"
98
" return (deliver);\n"
106
" if (!beresp.cacheable) {\n"
109
" if (beresp.http.Set-Cookie) {\n"
112
" return (deliver);\n"
115
"sub vcl_deliver {\n"
116
" return (deliver);\n"
120
" set obj.http.Content-Type = \"text/html; charset=utf-8\";\n"
122
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
123
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n"
124
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
127
" <title>\"} obj.status \" \" obj.response {\"</title>\n"
130
" <h1>Error \"} obj.status \" \" obj.response {\"</h1>\n"
131
" <p>\"} obj.response {\"</p>\n"
132
" <h3>Guru Meditation:</h3>\n"
133
" <p>XID: \"} req.xid {\"</p>\n"
135
" <p>Varnish cache server</p>\n"
139
" return (deliver);\n"