Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
c66fc9f3
Commit
c66fc9f3
authored
Jul 10, 2015
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop x- prefix following RFC6648
parent
5ec70b34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
purging.rst
doc/sphinx/users-guide/purging.rst
+5
-5
vmod.vcc
lib/libvmod_std/vmod.vcc
+11
-11
No files found.
doc/sphinx/users-guide/purging.rst
View file @
c66fc9f3
...
...
@@ -121,11 +121,11 @@ object is not available in the `ban lurker` thread.
You can use the following template to write `ban lurker` friendly bans::
sub vcl_backend_response {
set beresp.http.
x-
url = bereq.url;
set beresp.http.url = bereq.url;
}
sub vcl_deliver {
unset resp.http.
x-
url; # Optional
unset resp.http.url; # Optional
}
sub vcl_recv {
...
...
@@ -133,15 +133,15 @@ You can use the following template to write `ban lurker` friendly bans::
if (client.ip !~ purge) {
return(synth(403, "Not allowed"));
}
ban("obj.http.
x-
url ~ " + req.url); # Assumes req.url is a regex. This might be a bit too simple
ban("obj.http.url ~ " + req.url); # Assumes req.url is a regex. This might be a bit too simple
}
}
To inspect the current ban list, issue the ``ban.list`` command in the CLI. This
will produce a status of all current bans::
0xb75096d0 1318329475.377475 10 obj.http.
x-
url ~ test
0xb7509610 1318329470.785875 20G obj.http.
x-
url ~ test
0xb75096d0 1318329475.377475 10 obj.http.url ~ test
0xb7509610 1318329470.785875 20G obj.http.url ~ test
The ban list contains the ID of the ban, the timestamp when the ban
entered the ban list. A count of the objects that has reached this point
...
...
lib/libvmod_std/vmod.vcc
View file @
c66fc9f3
...
...
@@ -46,14 +46,14 @@ $Function STRING toupper(STRING_LIST s)
Description
Converts the string *s* to uppercase.
Example
set beresp.http.
x-
scream = std.toupper("yes!");
set beresp.http.scream = std.toupper("yes!");
$Function STRING tolower(STRING_LIST s)
Description
Converts the string *s* to lowercase.
Example
set beresp.http.
x-
nice = std.tolower("VerY");
set beresp.http.nice = std.tolower("VerY");
$Function VOID set_ip_tos(INT tos)
...
...
@@ -73,7 +73,7 @@ $Function REAL random(REAL lo, REAL hi)
Description
Returns a random real number between *lo* and *hi*.
Example
set beresp.http.
x-
random-number = std.random(1, 100);
set beresp.http.random-number = std.random(1, 100);
$Function VOID log(STRING_LIST s)
...
...
@@ -102,7 +102,7 @@ Description
function the caching in the function doesn't take this into
account. Also, files are not re-read.
Example
set beresp.http.
x-
served-by = std.fileread("/etc/hostname");
set beresp.http.served-by = std.fileread("/etc/hostname");
$Function VOID collect(HEADER hdr)
...
...
@@ -131,7 +131,7 @@ Description
Converts the string *s* to an integer. If conversion fails,
*fallback* will be returned.
Example
| if (std.integer(req.http.
x-
foo, 0) > 5) {
| if (std.integer(req.http.foo, 0) > 5) {
| ...
| }
...
...
@@ -152,7 +152,7 @@ Description
Converts the string *s* to a real. If conversion fails,
*fallback* will be returned.
Example
| if (std.real(req.http.
x-
foo, 0.0) > 5.5) {
| if (std.real(req.http.foo, 0.0) > 5.5) {
| ...
| }
...
...
@@ -161,21 +161,21 @@ $Function TIME real2time(REAL r)
Description
Converts the real *r* to a time.
Example
set req.http.
x-
time = std.real2time(1140618699.00);
set req.http.time = std.real2time(1140618699.00);
$Function INT time2integer(TIME t)
Description
Converts the time *t* to a integer.
Example
set req.http.
x-
int = std.time2integer(now);
set req.http.int = std.time2integer(now);
$Function REAL time2real(TIME t)
Description
Converts the time *t* to a real.
Example
set req.http.
x-
real = std.time2real(now);
set req.http.real = std.time2real(now);
$Function BOOL healthy(BACKEND be)
...
...
@@ -231,11 +231,11 @@ Description
Note that the comparison is case sensitive.
Example
| if (std.strstr(req.url, req.http.
x-
restrict)) {
| if (std.strstr(req.url, req.http.restrict)) {
| ...
| }
This will check if the content of req.http.
x-
restrict occurs
This will check if the content of req.http.restrict occurs
anywhere in req.url.
$Function TIME time(STRING s, TIME fallback)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment