diff options
| author | Kevin Fenzi <kevin@scrye.com> | 2016-05-18 17:39:43 +0000 |
|---|---|---|
| committer | Kevin Fenzi <kevin@scrye.com> | 2016-05-18 17:39:43 +0000 |
| commit | 71f5bd9bb55504d01e059e81f2b9aa77ca31b3b4 (patch) | |
| tree | 422f94065bbe9bfc2178b3fc06aad752035f8d50 | |
| parent | 03dd724e011f4cb99a44544ec1270ec573593682 (diff) | |
| download | ansible-71f5bd9bb55504d01e059e81f2b9aa77ca31b3b4.tar.gz ansible-71f5bd9bb55504d01e059e81f2b9aa77ca31b3b4.tar.xz ansible-71f5bd9bb55504d01e059e81f2b9aa77ca31b3b4.zip | |
Setup varnish to handle lists.fedoraproject.org.
| -rw-r--r-- | playbooks/include/proxies-reverseproxy.yml | 6 | ||||
| -rw-r--r-- | roles/haproxy/templates/haproxy.cfg | 7 | ||||
| -rw-r--r-- | roles/varnish/templates/proxy.vcl.j2 | 14 |
3 files changed, 18 insertions, 9 deletions
diff --git a/playbooks/include/proxies-reverseproxy.yml b/playbooks/include/proxies-reverseproxy.yml index 699857178..f063ad213 100644 --- a/playbooks/include/proxies-reverseproxy.yml +++ b/playbooks/include/proxies-reverseproxy.yml @@ -67,9 +67,11 @@ - role: httpd/reverseproxy website: lists.fedoraproject.org - proxyurl: http://localhost:10033 destname: mailman3 - when: env == "staging" + localpath: / + remotepath: / + header_scheme: true + proxyurl: "{{ varnish_url }}" # The place for the raw originals - role: httpd/reverseproxy diff --git a/roles/haproxy/templates/haproxy.cfg b/roles/haproxy/templates/haproxy.cfg index 3920add02..3cbab6266 100644 --- a/roles/haproxy/templates/haproxy.cfg +++ b/roles/haproxy/templates/haproxy.cfg @@ -214,13 +214,6 @@ listen badges 0.0.0.0:10032 option httpchk GET /heartbeat {% if env == "staging" %} -listen lists 0.0.0.0:10033 - balance hdr(appserver) - server mailman01 mailman01:80 check inter 10s rise 1 fall 2 - option httpchk GET / -{% endif %} - -{% if env == "staging" %} listen gallery balance hdr(appserver) server gallery01 gallery01:80 check inter 10s rise 1 fall 2 diff --git a/roles/varnish/templates/proxy.vcl.j2 b/roles/varnish/templates/proxy.vcl.j2 index 3244cae83..ba9d44b6b 100644 --- a/roles/varnish/templates/proxy.vcl.j2 +++ b/roles/varnish/templates/proxy.vcl.j2 @@ -19,6 +19,17 @@ backend pkgdb { .first_byte_timeout = 160s; } +backend mailman { + .host = "mailman01"; + .port = "http"; + .probe = { + .url = "/"; + .interval = 5s; + .timeout = 5s; + .expected_response = 301; + } +} + backend fas01 { .host = "fas01"; .port = "http"; @@ -275,6 +286,9 @@ sub vcl_recv { } } } + if (req.http.X-Forwarded-Server ~ "^lists.fedoraproject.org") { + set req.backend_hint = mailman; + } if (req.http.X-Forwarded-Server ~ "^apps.fedoraproject.org" || req.http.X-Forwarded-Server ~ "^apps.stg.fedoraproject.org") { if (req.url ~ "^/koschei") { set req.backend_hint = koschei; |
