diff --git a/playbooks/include/proxies-reverseproxy.yml b/playbooks/include/proxies-reverseproxy.yml index 82a21c7bc2..915ac9fc51 100644 --- a/playbooks/include/proxies-reverseproxy.yml +++ b/playbooks/include/proxies-reverseproxy.yml @@ -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 diff --git a/roles/varnish/templates/proxy.vcl.j2 b/roles/varnish/templates/proxy.vcl.j2 index 0b1de9955f..812b94bc70 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);