boost-proxy: copy whatever static content is available

This commit is contained in:
Jérémy Lecour 2022-11-27 13:03:29 +01:00 committed by Jérémy Lecour
parent 5663ebcecf
commit 450cb58c6f
12 changed files with 10 additions and 11 deletions

View file

@ -32,10 +32,12 @@
- haproxy - haproxy
- config - config
- name: Maintenance file is present - name: "Copy error pages"
copy: copy:
src: "templates/haproxy/maintenance.http" src: "templates/haproxy/static/"
dest: /etc/haproxy/errors/maintenance.http dest: "/etc/haproxy/errors/"
owner: root
group: root
mode: "0644" mode: "0644"
notify: reload haproxy notify: reload haproxy
tags: tags:

View file

@ -2,16 +2,13 @@
# HAProxy # HAProxy
- name: "Copy custom error pages for {{ site }}" - name: "Copy HAProxy static elements for {{ site }}"
template: copy:
src: "{{ template }}" src: "templates/boost-sites/{{ site }}/haproxy/static/"
dest: "/etc/haproxy/sites/{{ site }}/" dest: "/etc/haproxy/sites/{{ site }}/"
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
loop: "{{ query('fileglob', 'templates/boost-sites/{{ site }}/haproxy/*.http') }}"
loop_control:
loop_var: template
tags: tags:
- haproxy - haproxy
- config - config
@ -19,7 +16,7 @@
# Varnish # Varnish
- name: "Copy sites custom VCL config for {{ site }}" - name: "Copy Varnish custom VCL for {{ site }}"
template: template:
src: "templates/boost-sites/{{ site }}/varnish/default.vcl.j2" src: "templates/boost-sites/{{ site }}/varnish/default.vcl.j2"
dest: "/etc/varnish/sites/{{ site }}.vcl" dest: "/etc/varnish/sites/{{ site }}.vcl"

View file

@ -1,6 +1,6 @@
acl example_domains var(req.hdr_host) -m str example.com acl example_domains var(req.hdr_host) -m str example.com
acl example_domains2 var(req.hdr_host) -m str example.org www.example.org acl example_domains2 var(req.hdr_host) -m str example.org www.example.org
### acl example_maintenance_ips src -f /etc/haproxy/example/maintenance_ips ### acl example_maintenance_ips src -f /etc/haproxy/sites/{{ site }}/maintenance_ips
# Redirect to HTTPS without Let's Encrypt certificate # Redirect to HTTPS without Let's Encrypt certificate
### http-request redirect scheme https code 301 if example_domains !{ ssl_fc } ### http-request redirect scheme https code 301 if example_domains !{ ssl_fc }