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
da7d47ef
Commit
da7d47ef
authored
Mar 07, 2013
by
Per Buer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various cleanups
parent
93c5e395
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
10 additions
and
86 deletions
+10
-86
vcl.rst
doc/sphinx/reference/vcl.rst
+1
-1
index.rst
doc/sphinx/users-guide/index.rst
+1
-1
vcl-backends.rst
doc/sphinx/users-guide/vcl-backends.rst
+1
-4
vcl-example1-manipulating-headers.rst
doc/sphinx/users-guide/vcl-example1-manipulating-headers.rst
+0
-21
vcl-example2-manipulating-responses.rst
...phinx/users-guide/vcl-example2-manipulating-responses.rst
+0
-19
vcl-example3-acls.rst
doc/sphinx/users-guide/vcl-example3-acls.rst
+0
-34
vcl-examples.rst
doc/sphinx/users-guide/vcl-examples.rst
+4
-3
vcl.rst
doc/sphinx/users-guide/vcl.rst
+1
-1
websockets.rst
doc/sphinx/users-guide/websockets.rst
+2
-2
No files found.
doc/sphinx/reference/vcl.rst
View file @
da7d47ef
...
@@ -27,7 +27,7 @@ When a new configuration is loaded, the varnishd management process
...
@@ -27,7 +27,7 @@ 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.
.. include:: ../include/vcl-syntax.rst
..
..
include:: ../include/vcl-syntax.rst
.. include:: ../include/vcl-backends.rst
.. include:: ../include/vcl-backends.rst
...
...
doc/sphinx/users-guide/index.rst
View file @
da7d47ef
...
@@ -11,7 +11,7 @@ The guide is split into short chapters, each chapter explaining a
...
@@ -11,7 +11,7 @@ The guide is split into short chapters, each chapter explaining a
separate topic.
separate topic.
.. toctree::
.. toctree::
:maxdepth:
3
:maxdepth:
2
configuration
configuration
vcl
vcl
...
...
doc/sphinx/users-guide/vcl-backends.rst
View file @
da7d47ef
...
@@ -7,10 +7,7 @@ Varnish has a concept of "backend" or "origin" servers. A backend
...
@@ -7,10 +7,7 @@ Varnish has a concept of "backend" or "origin" servers. A backend
server is the server providing the content Varnish will accelerate.
server is the server providing the content Varnish will accelerate.
Our first task is to tell Varnish where it can find its content. Start
Our first task is to tell Varnish where it can find its content. Start
your favorite text editor and open the varnish default configuration
your favorite text editor and open the relevant VCL file.
file. If you installed from source this is
/usr/local/etc/varnish/default.vcl, if you installed from a package it
is probably /etc/varnish/default.vcl.
Somewhere in the top there will be a section that looks a bit like this.::
Somewhere in the top there will be a section that looks a bit like this.::
...
...
doc/sphinx/users-guide/vcl-example1-manipulating-headers.rst
deleted
100644 → 0
View file @
93c5e395
Manipulating request headers in VCL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lets say we want to remove the cookie for all objects in the /images
directory of our web server::
sub vcl_recv {
if (req.url ~ "^/images") {
unset req.http.cookie;
}
}
Now, when the request is handled to the backend server there will be
no cookie header. The interesting line is the one with the
if-statement. It matches the URL, taken from the request object, and
matches it against the regular expression. Note the match operator. If
it matches the Cookie: header of the request is unset (deleted).
doc/sphinx/users-guide/vcl-example2-manipulating-responses.rst
deleted
100644 → 0
View file @
93c5e395
Altering the backend response
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here we override the TTL of a object comming from the backend if it
matches certain criteria::
sub vcl_fetch {
if (req.url ~ "\.(png|gif|jpg)$") {
unset beresp.http.set-cookie;
set beresp.ttl = 1h;
}
}
.. XXX ref hit-for-pass
We also remove any Set-Cookie headers in order to avoid a hit-for-pass
object to be created.
doc/sphinx/users-guide/vcl-example3-acls.rst
deleted
100644 → 0
View file @
93c5e395
ACLs
~~~~
You create a named access control list with the *acl* keyword. You can match
the IP address of the client against an ACL with the match operator.::
# Who is allowed to purge....
acl local {
"localhost";
"192.168.1.0"/24; /* and everyone on the local network */
! "192.168.1.23"; /* except for the dialin router */
}
sub vcl_recv {
if (req.method == "PURGE") {
if (client.ip ~ local) {
return(lookup);
}
}
}
sub vcl_hit {
if (req.method == "PURGE") {
set obj.ttl = 0s;
error 200 "Purged.";
}
}
sub vcl_miss {
if (req.method == "PURGE") {
error 404 "Not in cache.";
}
}
doc/sphinx/users-guide/vcl-examples.rst
View file @
da7d47ef
...
@@ -7,8 +7,9 @@ capabilites of the VCL language.
...
@@ -7,8 +7,9 @@ capabilites of the VCL language.
.. toctree::
.. toctree::
vcl-example1-manipulating-headers
vcl-example-manipulating-headers
vcl-example2-manipulating-responses
vcl-example-manipulating-responses
vcl-example3-acls
vcl-example-acls
vcl-example-websockets
doc/sphinx/users-guide/vcl.rst
View file @
da7d47ef
...
@@ -27,7 +27,7 @@ code commented out in default.vcl that ships with Varnish Cache.
...
@@ -27,7 +27,7 @@ code commented out in default.vcl that ships with Varnish Cache.
.. _users-guide-vcl_fetch_actions:
.. _users-guide-vcl_fetch_actions:
.. toctree::
.. toctree::
:maxdepth:
2
:maxdepth:
1
vcl-syntax
vcl-syntax
vcl-built-in-subs
vcl-built-in-subs
...
...
doc/sphinx/users-guide/websockets.rst
View file @
da7d47ef
Using Websockets
Implementing websocket support
----------------
----------------
--------------
Websockets is a technology for creating a bidirectional stream-based channel over HTTP.
Websockets is a technology for creating a bidirectional stream-based channel over HTTP.
...
...
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