Merge patch to have nuancier use Varnish (#3294C14,17)

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2015-12-01 19:56:03 +00:00
parent bbcae051b2
commit 53b20e51da
2 changed files with 20 additions and 1 deletions

View file

@ -92,7 +92,7 @@
localpath: /nuancier
remotepath: /nuancier
header_scheme: true
proxyurl: http://localhost:10035
proxyurl: "{{ varnish_url }}"
- role: httpd/reverseproxy
website: apps.fedoraproject.org

View file

@ -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);