summaryrefslogtreecommitdiffstats
path: root/roles/varnish
diff options
context:
space:
mode:
authorPatrick Uiterwijk <puiterwijk@redhat.com>2015-12-01 19:56:03 +0000
committerPatrick Uiterwijk <puiterwijk@redhat.com>2015-12-01 19:56:11 +0000
commit53b20e51da397c2edd9183c489867dd6b3ac45cc (patch)
tree295d7515af73cce684e451517410640aa50c926e /roles/varnish
parentbbcae051b26d1de0b8e927b054ae4248c2037aa1 (diff)
downloadansible-53b20e51da397c2edd9183c489867dd6b3ac45cc.tar.gz
ansible-53b20e51da397c2edd9183c489867dd6b3ac45cc.tar.xz
ansible-53b20e51da397c2edd9183c489867dd6b3ac45cc.zip
Merge patch to have nuancier use Varnish (#3294C14,17)
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'roles/varnish')
-rw-r--r--roles/varnish/templates/proxy.vcl.j219
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/varnish/templates/proxy.vcl.j2 b/roles/varnish/templates/proxy.vcl.j2
index 0b1de9955..812b94bc7 100644
--- a/roles/varnish/templates/proxy.vcl.j2
+++ b/roles/varnish/templates/proxy.vcl.j2
@@ -62,6 +62,11 @@ sub vcl_init {
fas.add_backend(fas03);
}
+backend nuancier {
+ .host = "localhost";
+ .port = "10035";
+}
+
backend voting {
.host = "localhost";
.port = "10007";
@@ -285,6 +290,20 @@ sub vcl_recv {
}
}
+ if (req.http.X-Forwarded-Server ~ "^apps.fedoraproject.org") {
+ if (req.url ~ "^/nuancier") {
+ set req.backend_hint = nuancier;
+ if (req.url ~ "^/nuancier/static/") {
+ unset req.http.cookie;
+ set req.url = regsub(req.url, "\?.*", "");
+ }
+ if (req.url ~ "^/nuancier/cache/") {
+ unset req.http.cookie;
+ set req.url = regsub(req.url, "\?.*", "");
+ }
+ }
+ }
+
# Pass any requests with the "If-None-Match" header directly.
if (req.http.If-None-Match) {
return (pass);