diff --git a/playbooks/include/proxies-reverseproxy.yml b/playbooks/include/proxies-reverseproxy.yml index a55472fd71..904428a116 100644 --- a/playbooks/include/proxies-reverseproxy.yml +++ b/playbooks/include/proxies-reverseproxy.yml @@ -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 diff --git a/roles/varnish/files/proxy.vcl b/roles/varnish/files/proxy.vcl index 37ca3da7ca..ed8333b672 100644 --- a/roles/varnish/files/proxy.vcl +++ b/roles/varnish/files/proxy.vcl @@ -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; + } +}