1VCL-BACKENDS(7)                                                VCL-BACKENDS(7)
2
3
4

NAME

6       VCL-backends - Configuring Backends
7

BACKEND DEFINITION

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

ATTRIBUTE .HOST

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          .host = "example.com:http";
44

ATTRIBUTE .PORT

46       The TCP port number or service name can be specified as part  of  .host
47       as above or separately using the .port attribute:
48
49          .port = "8081";
50
51          .port = "http";
52

ATTRIBUTE .PATH

54       The absolute path to a Unix(4) domain socket of a local backend:
55
56          .path = "/var/run/http.sock";
57
58       A  warning will be issued if the uds-socket does not exist when the VCL
59       is loaded.  This makes it possible to start the UDS-listening peer,  or
60       set the socket file's permissions afterwards.
61
62       If  the  uds-socket  socket  does not exist or permissions deny access,
63       connection attempts will fail.
64

ATTRIBUTE .HOST_HEADER

66       A host header to add to probes and regular  backend  requests  if  they
67       have no such header:
68
69          .host_header = "Host: example.com";
70

TIMEOUT ATTRIBUTES

72       These  attributes  control  how  patient  varnishd  is  during  backend
73       fetches:
74
75          .connect_timeout = 1.4s;
76          .first_byte_timeout = 20s;
77          .between_bytes_timeout = 10s;
78
79       The default values comes parameters  with  the  same  names,  see  var‐
80       nishd(1).
81

ATTRIBUTE .MAX_CONNECTIONS

83       Limit  how  many simultaneous connections varnish can open to the back‐
84       end:
85
86          .max_connections = 1000;
87

ATTRIBUTE .PROXY_HEADER

89       Send a PROXY protocol header to the  backend  with  the  client.ip  and
90       server.ip values:
91
92          .proxy_header = 2;
93
94       Legal values are one and two, depending which version of the PROXY pro‐
95       tocol you want.
96
97       Notice this setting will lead to backend connections being used  for  a
98       single  request only (subject to future improvements). Thus, extra care
99       should be taken to avoid running into failing backend connections  with
100       EADDRNOTAVAIL  due  to no local ports being available. Possible options
101       are:
102
103          • Use additional backend connections to extra IP  addresses  or  TCP
104            ports
105
106          • Increase   the   number   of   available   ports   (Linux   sysctl
107            net.ipv4.ip_local_port_range)
108
109          • Reuse   backend   connection    ports    early    (Linux    sysctl
110            net.ipv4.tcp_tw_reuse)
111

ATTRIBUTE .PREAMBLE

113       Send a BLOB on all newly opened connections to the backend:
114
115          .preamble = :SGVsbG8gV29ybGRcbgo=:;
116

ATTRIBUTE .PROBE

118       Please see vcl-probe(7).
119

SEE ALSO

121varnishd(1)
122
123vcl(7)
124
125vcl-probe(7)
126
127vmod_directors(3)
128
129vmod_std(3)
130

HISTORY

132       VCL was developed by Poul-Henning Kamp in cooperation with Verdens Gang
133       AS, Redpill Linpro and Varnish Software.  This manual page  is  written
134       by  Per  Buer,  Poul-Henning Kamp, Martin Blix Grydeland, Kristian Lyn‐
135       gstøl, Lasse Karstensen and others.
136
138       This document is licensed under the same license as Varnish itself. See
139       LICENSE for details.
140
141       • Copyright (c) 2006 Verdens Gang AS
142
143       • Copyright (c) 2006-2021 Varnish Software AS
144
145
146
147
148                                                               VCL-BACKENDS(7)
Impressum