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
836d8559
Commit
836d8559
authored
Mar 20, 2014
by
Per Buer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to vcl_error.
parent
dd54b29a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
16 deletions
+10
-16
devicedetection.rst
doc/sphinx/users-guide/devicedetection.rst
+2
-2
purging.rst
doc/sphinx/users-guide/purging.rst
+3
-3
vcl-built-in-subs.rst
doc/sphinx/users-guide/vcl-built-in-subs.rst
+5
-11
No files found.
doc/sphinx/users-guide/devicedetection.rst
View file @
836d8559
...
...
@@ -251,11 +251,11 @@ VCL::
# call some detection engine
if (req.http.X-UA-Device ~ "^mobile" || req.http.X-UA-device ~ "^tablet") {
error 750 "Moved Temporarily"
;
return(synth(750, "Moved Temporarily"))
;
}
}
sub vcl_
error
{
sub vcl_
synth
{
if (obj.status == 750) {
set obj.http.Location = "http://m.example.com" + req.url;
set obj.status = 302;
...
...
doc/sphinx/users-guide/purging.rst
View file @
836d8559
...
...
@@ -99,14 +99,14 @@ You can also add bans to Varnish via HTTP. Doing so requires a bit of VCL::
if (req.method == "BAN") {
# Same ACL check as above:
if (!client.ip ~ purge) {
error 405 "Not allowed."
;
return(synth(403, "Not allowed."))
;
}
ban("req.http.host == " + req.http.host +
"&& req.url == " + req.url);
# Throw a synthetic page so the
# request won't go to the backend.
return(synth(200
m
"Ban added"));
return(synth(200
,
"Ban added"));
}
}
...
...
@@ -130,7 +130,7 @@ You can use the following template to write ban lurker friendly bans::
sub vcl_recv {
if (req.method == "PURGE") {
if (client.ip !~ purge) {
error 401 "Not allowed"
;
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
}
...
...
doc/sphinx/users-guide/vcl-built-in-subs.rst
View file @
836d8559
...
...
@@ -22,8 +22,9 @@ yourself doing frequently.
The vcl_recv subroutine may terminate with calling ``return()`` on one
of the following keywords:
error
Return the specified error code to the client and abandon the request.
synth
Return a synthetic object with the specified error code to the
client and abandon the request.
pass
Switch to pass mode. Control will eventually pass to vcl_pass.
...
...
@@ -51,7 +52,7 @@ shuffling bytes back and forth.
The vcl_pipe subroutine may terminate with calling return() with one
of the following keywords:
error code [reason]
synth(error code, reason)
Return the specified error code to the client and abandon the request.
pipe
...
...
@@ -68,7 +69,7 @@ submitted over the same client connection are handled normally.
The vcl_pass subroutine may terminate with calling return() with one
of the following keywords:
error [reason]
synth(error code, reason)
Return the specified error code to the client and abandon the request.
pass
...
...
@@ -157,13 +158,6 @@ keywords:
error.
.. XXX
.. vcl_error
.. ~~~~~~~~~
.. Not sure if we're going to keep this around.
vcl_backend_fetch
~~~~~~~~~~~~~~~~~
...
...
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