Revision [4151]

Last edited on 2011-09-14 05:12:31 by KenFong
Additions:
===modify host header===
One can modify the host header of incoming request in the vcl_recv section:
# set host header
set req.http.Host = "www.waterlovinghead.com";
...


Revision [2246]

Edited on 2009-03-23 01:05:22 by WikiAdmin
Additions:
===Varnishadm===
Flush all cache
varnishadm -T 127.0.0.1:6082 url.purge "."


Revision [2201]

Edited on 2009-02-12 19:59:45 by WikiAdmin
Additions:
# do not cache POST
if (req.request == "POST" ) {
return (pass);
}
if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
/* Non-RFC2616 or CONNECT which is weird. */
return (pipe);
}
if (req.request != "GET" && req.request != "HEAD") {
/* We only deal with GET and HEAD by default */
return (pass);
}
if (req.http.Authorization || req.http.Cookie) {
/* Not cacheable by default */
return (pass);
}
return (lookup);


Revision [2187]

Edited on 2009-02-09 19:58:08 by WikiAdmin
Additions:
pipe;
Deletions:
pipe;
}


Revision [2186]

Edited on 2009-02-09 19:57:50 by WikiAdmin
Additions:
// Do not cache authenticated session
if (req.http.Cookie && req.http.Cookie ~ "authtoken=") {
pipe;
}
lookup;
Deletions:
pipe;


Revision [2006]

Edited on 2008-10-16 08:49:21 by WikiAdmin
Additions:
v2.0 style (plus ip + url filter)
.host = "127.0.0.1";
.port = "801";
acl localip {
"192.168.13.10";

if (client.ip ~ localip) {
if (req.url ~ "^/admin") {
error 403 "Hmm...";
}
}
}
V1.x style


Revision [1984]

Edited on 2008-10-04 14:20:28 by WikiAdmin
Additions:
pipe;
Deletions:
sub checkurl {
call checkurl;
lookup;


Revision [1983]

Edited on 2008-10-04 13:57:48 by WikiAdmin
Additions:
sub checkurl {
call checkurl;


Revision [1982]

Edited on 2008-10-04 13:20:17 by WikiAdmin
Additions:
error 403 "Access restricted.";
}
Deletions:
error 403 "Access restricted.";
}


Revision [1981]

Edited on 2008-10-04 13:19:55 by WikiAdmin
Additions:
acl clientnet {
"1.2.3.4";
"2.3.4.5";
# filter access to certain url
if (req.url ~ "^/admin") {
if (!client.ip ~ clientnet) {
error 403 "Access restricted.";
}


Revision [1904]

Edited on 2008-08-20 02:29:43 by WikiAdmin
Additions:
lookup;
There are three keywords with vcl file:
pipe: check the next rule
pass: do not cache
lookup: cache


Revision [1903]

The oldest known version of this page was created on 2008-08-20 02:28:24 by WikiAdmin
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki