-
Notifications
You must be signed in to change notification settings - Fork 6
/
varnish.cfg
69 lines (60 loc) · 1.63 KB
/
varnish.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
[buildout]
parts +=
varnish-build
varnish
varnish-conf
supervisor
test-wrap-varnish
[hosts]
supervisor = localhost
plone-testing = 127.0.0.1
varnish = localhost
varnish-telnet = localhost
[ports]
supervisor = 9001
plone-testing = 55000
varnish = 55001
varnish-telnet = 5001
[environment]
ZSERVER_HOST = ${hosts:plone-testing}
ZSERVER_PORT = ${ports:plone-testing}
ROBOT_ZOPE_HOST = ${hosts:varnish}
ROBOT_ZOPE_PORT = ${ports:varnish}
[test]
environment = environment
script = run-tests
[test-wrap-varnish]
recipe = collective.recipe.template
input = inline:
#!/usr/bin/env sh
${buildout:directory}/bin/supervisord
${buildout:directory}/bin/run-tests $@
result=$?
${buildout:directory}/bin/supervisorctl shutdown
exit $result
output = ${buildout:directory}/bin/test
mode = 755
[varnish-build]
recipe = plone.recipe.varnish:build
[varnish]
recipe = plone.recipe.varnish:script
bind = ${hosts:varnish}:${ports:varnish}
telnet = ${hosts:varnish-telnet}:${ports:varnish-telnet}
cache-size = 256M
mode = foreground
configuration-part = varnish-conf
[varnish-conf]
recipe = plone.recipe.varnish:configuration
backends = ${hosts:plone-testing}:${ports:plone-testing}
vcl_recv =
set req.http.UrlNoQs = regsub(req.url, "\?.*$", "");
if (req.http.UrlNoQs !~ "\.(js|css|kss)$") {
return(pass);
}
[supervisor]
recipe = collective.recipe.supervisor
port = ${hosts:supervisor}:${ports:supervisor}
user = admin
password = admin
programs =
10 varnish ${varnish:daemon} [ -f ${varnish:configuration-file} -n ${buildout:directory}/var -s malloc,1G -a ${hosts:varnish}:${ports:varnish} -F ] ${buildout:directory}