Use varnish for mirrormanager2 publiclist

This change makes us use varnish for the mm2 publiclist
and configures varnish to ignore cookies on the /mirrors
subpath.
The cookie ignore is only valid after the master-noauth
Pull Request #80 is merged, as that hides all authed
information from the publiclist pages.

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2015-05-19 16:32:38 +00:00
parent 9c93224576
commit 77668348c0
2 changed files with 14 additions and 9 deletions

View file

@ -216,15 +216,6 @@
proxyurl: http://localhost:10009
- role: httpd/reverseproxy
when: env != "staging"
website: admin.fedoraproject.org
destname: mirrormanager
remotepath: /mirrormanager
localpath: /mirrormanager
proxyurl: http://localhost:10008
- role: httpd/reverseproxy
when: env == "staging"
website: admin.fedoraproject.org
destname: mirrormanager
remotepath: /mirrormanager

View file

@ -187,6 +187,10 @@ sub vcl_recv {
unset req.http.cookie;
set req.url = regsub(req.url, "\?.*", "");
}
if (req.url ~ "^/mirrormanager/mirrors") {
unset req.http.cookie;
set req.url = regsub(req.url, "\?.*", "");
}
}
if (req.url ~ "^/mirrormanager2/") {
set req.backend_hint = mirrormanager2;
@ -299,3 +303,13 @@ sub vcl_recv {
# unset beresp.http.set-cookie;
# }
#}
# Make sure mirrormanager/mirrors doesn't set any cookies
# (Setting cookies would make varnish store a HIT-FOR-PASS
# making it always fetch from backend)
sub vcl_backend_response {
if (bereq.url ~ "^/mirrormanager/mirrors") {
unset beresp.http.set-cookie;
}
}