diff --git a/templates/haproxy_cfg.jinja2 b/templates/haproxy_cfg.jinja2 index ed5373d2b9c25c40349f05764155c108f6bc1702..bc8ef970869ca070acf86de4d6bd8b8c2a673cfd 100644 --- a/templates/haproxy_cfg.jinja2 +++ b/templates/haproxy_cfg.jinja2 @@ -286,6 +286,9 @@ backend backend_{{host}} {% if host == inventory_hostname or host == 'localhost' %} http-response deny {% else %} +{% for line in hostvars[host]['proxy_backend_extra_lines']|default([]) %} + {{ line }} +{% endfor %} server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 check maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}} {% endif %} @@ -293,6 +296,9 @@ backend backend_{{host}}_bigpipe {% if host == inventory_hostname or host == 'localhost' %} http-response deny {% else %} +{% for line in hostvars[host]['proxy_backend_extra_lines']|default([]) %} + {{ line }} +{% endfor %} no option http-buffer-request server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 check maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}} {% endif %} @@ -301,6 +307,9 @@ backend backend_{{host}}_https {% if host == inventory_hostname or host == 'localhost' %} http-response deny {% else %} +{% for line in hostvars[host]['proxy_backend_extra_lines']|default([]) %} + {{ line }} +{% endfor %} http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;" server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 check maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}} {% endif %} @@ -309,6 +318,9 @@ backend backend_{{host}}_https_bigpipe {% if host == inventory_hostname or host == 'localhost' %} http-response deny {% else %} +{% for line in hostvars[host]['proxy_backend_extra_lines']|default([]) %} + {{ line }} +{% endfor %} no option http-buffer-request http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;" server server_{{host}} {{hostvars[host]['static_ipv4']}}:80 check maxconn {{hostvars[host]['proxy_maxconn']|default(proxy_maxconn)}}