From b5c4af2f26237149fcb8b8afc6e6788d722ab47e Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sat, 4 Mar 2017 19:32:54 +0000 Subject: [PATCH] add modernpaste02 to haproxy and varnish to cache paste static stuff --- playbooks/include/proxies-reverseproxy.yml | 2 +- roles/haproxy/templates/haproxy.cfg | 1 + roles/varnish/templates/proxy.vcl.j2 | 9 ++------- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/playbooks/include/proxies-reverseproxy.yml b/playbooks/include/proxies-reverseproxy.yml index ba08aeb7cb..9c719a4dc8 100644 --- a/playbooks/include/proxies-reverseproxy.yml +++ b/playbooks/include/proxies-reverseproxy.yml @@ -144,7 +144,7 @@ - role: httpd/reverseproxy website: paste.fedoraproject.org destname: modernpaste - proxyurl: http://localhost:10055 + proxyurl: "{{ varnish_url }}" - role: httpd/reverseproxy website: admin.fedoraproject.org diff --git a/roles/haproxy/templates/haproxy.cfg b/roles/haproxy/templates/haproxy.cfg index 567f36fb74..45190705d4 100644 --- a/roles/haproxy/templates/haproxy.cfg +++ b/roles/haproxy/templates/haproxy.cfg @@ -368,6 +368,7 @@ listen docker-candidate-registry 0.0.0.0:10054 listen modernpaste 0.0.0.0:10055 balance hdr(appserver) server modernpaste01 modernpaste01:80 check inter 10s rise 1 fall 2 + server modernpaste02 modernpaste02:80 check inter 10s rise 1 fall 2 option httpchk GET / {% if inventory_hostname_short == 'proxy01' or inventory_hostname_short == 'proxy10' %} diff --git a/roles/varnish/templates/proxy.vcl.j2 b/roles/varnish/templates/proxy.vcl.j2 index a1043622cc..a129f2dae7 100644 --- a/roles/varnish/templates/proxy.vcl.j2 +++ b/roles/varnish/templates/proxy.vcl.j2 @@ -132,7 +132,7 @@ backend kerneltest { backend paste { .host = "localhost"; - .port = "10027"; + .port = "10055"; } backend koschei { @@ -272,12 +272,7 @@ sub vcl_recv { } if (req.http.X-Forwarded-Server ~ "^paste.fedoraproject.org") { set req.backend_hint = paste; - if (req.url ~ "^/skins/") { - unset req.http.cookie; - set req.http.clear-cookies = "yes"; - set req.url = regsub(req.url, "\?.*", ""); - } - if (req.url ~ "^/addons/") { + if (req.url ~ "^/static/") { unset req.http.cookie; set req.http.clear-cookies = "yes"; set req.url = regsub(req.url, "\?.*", "");