Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
a057cfa7
Commit
a057cfa7
authored
Sep 09, 2012
by
Per Buer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to split out small chunks of man vcl into separate bitsize files for reuse in users guide
parent
d6aca56d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
109 deletions
+112
-109
vcl-backends.rst
doc/sphinx/include/vcl-backends.rst
+44
-0
vcl-syntax.rst
doc/sphinx/include/vcl-syntax.rst
+65
-0
vcl.rst
doc/sphinx/reference/vcl.rst
+3
-109
No files found.
doc/sphinx/include/vcl-backends.rst
0 → 100644
View file @
a057cfa7
Backend declarations
--------------------
A backend declaration creates and initializes a named backend object:
::
backend www {
.host = "www.example.com";
.port = "http";
}
The backend object can later be used to select a backend at request time:
::
if (req.http.host ~ "(?i)^(www.)?example.com$") {
set req.backend = www;
}
To avoid overloading backend servers, .max_connections can be set to
limit the maximum number of concurrent backend connections.
The timeout parameters can be overridden in the backend declaration.
The timeout parameters are .connect_timeout for the time to wait for a
backend connection, .first_byte_timeout for the time to wait for the
first byte from the backend and .between_bytes_timeout for time to
wait between each received byte.
These can be set in the declaration like this:
::
backend www {
.host = "www.example.com";
.port = "http";
.connect_timeout = 1s;
.first_byte_timeout = 5s;
.between_bytes_timeout = 2s;
}
To mark a backend as unhealthy after number of items have been added
to its saintmode list ``.saintmode_threshold`` can be set to the maximum
list size. Setting a value of 0 disables saint mode checking entirely
for that backend. The value in the backend declaration overrides the
parameter.
doc/sphinx/include/vcl-syntax.rst
0 → 100644
View file @
a057cfa7
VCL SYNTAX
==========
The VCL syntax is very simple, and deliberately similar to C and Perl.
Blocks are delimited by curly braces, statements end with semicolons,
and comments may be written as in C, C++ or Perl according to your own
preferences.
In addition to the C-like assignment (=), comparison (==, !=) and
boolean (!, && and \|\|) operators, VCL supports both regular
expression and ACL matching using the ~ and the !~ operators.
Basic strings are enclosed in " ... ", and may not contain newlines.
Long strings are enclosed in {" ... "}. They may contain any
character including ", newline and other control characters except
for the NUL (0x00) character.
Unlike C and Perl, the backslash (\) character has no special meaning
in strings in VCL, so it can be freely used in regular expressions
without doubling.
Strings are concatenated using the '+' operator.
Assignments are introduced with the *set* keyword. There are no
user-defined variables; values can only be assigned to variables
attached to backend, request or document objects. Most of these are
typed, and the values assigned to them must have a compatible unit
suffix.
You can use the *set* keyword to arbitrary HTTP headers. You can
remove headers with the *remove* or *unset* keywords, which are
synonym.
You can use the *rollback* keyword to revert any changes to req at
any time.
The *synthetic* keyword is used to produce a synthetic response
body in vcl_error. It takes a single string as argument.
You can force a crash of the client process with the *panic* keyword.
*panic* takes a string as argument.
The ``return(action)`` keyword terminates the subroutine. *action* can be,
depending on context one of
* deliver
* error
* fetch
* hash
* hit_for_pass
* lookup
* ok
* pass
* pipe
* restart
Please see the list of subroutines to see what return actions are
available where.
VCL has if tests, but no loops.
The contents of another VCL file may be inserted at any point in the
code by using the *include* keyword followed by the name of the other
file as a quoted string.
doc/sphinx/reference/vcl.rst
View file @
a057cfa7
...
@@ -27,117 +27,11 @@ When a new configuration is loaded, the varnishd management process
...
@@ -27,117 +27,11 @@ When a new configuration is loaded, the varnishd management process
translates the VCL code to C and compiles it to a shared object which
translates the VCL code to C and compiles it to a shared object which
is then dynamically linked into the server process.
is then dynamically linked into the server process.
SYNTAX
.. include:: ../include/vcl-syntax.rst
======
The VCL syntax is very simple, and deliberately similar to C and Perl.
.. include:: ../include/vcl-backends.rst
Blocks are delimited by curly braces, statements end with semicolons,
and comments may be written as in C, C++ or Perl according to your own
preferences.
In addition to the C-like assignment (=), comparison (==, !=) and
.. _ref-vcl-director:
boolean (!, && and \|\|) operators, VCL supports both regular
expression and ACL matching using the ~ and the !~ operators.
Basic strings are enclosed in " ... ", and may not contain newlines.
Long strings are enclosed in {" ... "}. They may contain any
character including ", newline and other control characters except
for the NUL (0x00) character.
Unlike C and Perl, the backslash (\) character has no special meaning
in strings in VCL, so it can be freely used in regular expressions
without doubling.
Strings are concatenated using the '+' operator.
Assignments are introduced with the *set* keyword. There are no
user-defined variables; values can only be assigned to variables
attached to backend, request or document objects. Most of these are
typed, and the values assigned to them must have a compatible unit
suffix.
You can use the *set* keyword to arbitrary HTTP headers. You can
remove headers with the *remove* or *unset* keywords, which are
synonym.
You can use the *rollback* keyword to revert any changes to req at
any time.
The *synthetic* keyword is used to produce a synthetic response
body in vcl_error. It takes a single string as argument.
You can force a crash of the client process with the *panic* keyword.
*panic* takes a string as argument.
The ``return(action)`` keyword terminates the subroutine. *action* can be,
depending on context one of
* deliver
* error
* fetch
* hash
* hit_for_pass
* lookup
* ok
* pass
* pipe
* restart
Please see the list of subroutines to see what return actions are
available where.
VCL has if tests, but no loops.
The contents of another VCL file may be inserted at any point in the
code by using the *include* keyword followed by the name of the other
file as a quoted string.
Backend declarations
--------------------
A backend declaration creates and initializes a named backend object:
::
backend www {
.host = "www.example.com";
.port = "http";
}
The backend object can later be used to select a backend at request time:
::
if (req.http.host ~ "(?i)^(www.)?example.com$") {
set req.backend = www;
}
To avoid overloading backend servers, .max_connections can be set to
limit the maximum number of concurrent backend connections.
The timeout parameters can be overridden in the backend declaration.
The timeout parameters are .connect_timeout for the time to wait for a
backend connection, .first_byte_timeout for the time to wait for the
first byte from the backend and .between_bytes_timeout for time to
wait between each received byte.
These can be set in the declaration like this:
::
backend www {
.host = "www.example.com";
.port = "http";
.connect_timeout = 1s;
.first_byte_timeout = 5s;
.between_bytes_timeout = 2s;
}
To mark a backend as unhealthy after number of items have been added
to its saintmode list ``.saintmode_threshold`` can be set to the maximum
list size. Setting a value of 0 disables saint mode checking entirely
for that backend. The value in the backend declaration overrides the
parameter.
.. _reference-vcl-director:
Directors
Directors
---------
---------
...
...
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