1VCL-BACKENDS(7) VCL-BACKENDS(7)
2
3
4
6 VCL-backends - Configuring Backends
7
9 A backend declaration creates and initialises a named backend object.
10 A declaration start with the keyword backend followed by the name of
11 the backend. The actual declaration is in curly brackets, in a
12 key/value fashion.:
13
14 backend name {
15 .attribute1 = value;
16 .attribute2 = value;
17 [...]
18 }
19
20 If there is a backend named default it will be used unless another
21 backend is explicitly set. If no backend is named default the first
22 backend in the VCL program becomes the default.
23
24 If you only use dynamic backends created by VMODs, an empty, always
25 failing (503) backend can be specified:
26
27 backend default none;
28
29 A backend must be specified with either a .host or a .path attribute,
30 but not both. All other attributes have default values.
31
33 To specify a networked backend .host takes either a numeric IPv4/IPv6
34 address or a domain name which resolves to at most one IPv4 and one
35 IPv6 address:
36
37 .host = "127.0.0.1";
38
39 .host = "[::1]:8080";
40
41 .host = "example.com:8081";
42
43 The TCP port number can be specified as part of .host as above or sepa‐
44 rately using the .port attribute:
45
46 .port = 8081;
47
49 The absolute path to a Unix(4) domain socket of a local backend:
50
51 .path = "/var/run/http.sock";
52
53 A warning will be issued if the uds-socket does not exist when the VCL
54 is loaded. This makes it possible to start the UDS-listening peer, or
55 set the socket file's permissions afterwards.
56
57 If the uds-socket socket does not exist or permissions deny access,
58 connection attempts will fail.
59
61 A host header to add to probes and regular backend requests if they
62 have no such header:
63
64 .host_header = "Host: example.com";
65
67 These attributes control how patient varnishd is during backend
68 fetches:
69
70 .connect_timeout = 1.4s;
71 .first_byte_timeout = 20s;
72 .between_bytes_timeout = 10s;
73
74 The default values comes parameters with the same names, see var‐
75 nishd(1).
76
78 Limit how many simultaneous connections varnish can open to the back‐
79 end:
80
81 .max_connections = 1000;
82
84 Send a PROXY protocol header to the backend with the client.ip and
85 server.ip values:
86
87 .proxy_header = 2;
88
89 Legal values are one and two, depending which version of the PROXY pro‐
90 tocol you want.
91
92 Notice this setting will lead to backend connections being used for a
93 single request only (subject to future improvements). Thus, extra care
94 should be taken to avoid running into failing backend connections with
95 EADDRNOTAVAIL due to no local ports being available. Possible options
96 are:
97
98 • Use additional backend connections to extra IP addresses or TCP
99 ports
100
101 • Increase the number of available ports (Linux sysctl
102 net.ipv4.ip_local_port_range)
103
104 • Reuse backend connection ports early (Linux sysctl
105 net.ipv4.tcp_tw_reuse)
106
108 Send a BLOB on all newly opened connections to the backend:
109
110 .preamble = :SGVsbG8gV29ybGRcbgo=:;
111
113 Please see vcl-probe(7).
114
116 • varnishd(1)
117
118 • vcl(7)
119
120 • vcl-probe(7)
121
122 • vmod_directors(3)
123
124 • vmod_std(3)
125
127 VCL was developed by Poul-Henning Kamp in cooperation with Verdens Gang
128 AS, Redpill Linpro and Varnish Software. This manual page is written
129 by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland, Kristian Lyn‐
130 gstøl, Lasse Karstensen and others.
131
133 This document is licensed under the same license as Varnish itself. See
134 LICENSE for details.
135
136 • Copyright (c) 2006 Verdens Gang AS
137
138 • Copyright (c) 2006-2021 Varnish Software AS
139
140
141
142
143 VCL-BACKENDS(7)