diff --git a/templates/etc/haproxy/frontend.cfg.j2 b/templates/etc/haproxy/frontend.cfg.j2 index d1867914..c6d51063 100644 --- a/templates/etc/haproxy/frontend.cfg.j2 +++ b/templates/etc/haproxy/frontend.cfg.j2 @@ -51,16 +51,6 @@ frontend {{ frontend.name }} capture {{ capture.type }} {{ capture.name }} len {{ capture.length }} {% endfor %} -{% for http_request in frontend.http_request | default([]) %} - http-request {{ http_request.action }}{% if http_request.param is defined %} {{ http_request.param }}{% endif %}{% if http_request.cond is defined %} {{ http_request.cond }}{% endif %} - -{% endfor %} - -{% for http_response in frontend.http_response | default([]) %} - http-response {{ http_response.action }}{% if http_response.param is defined %} {{ http_response.param }}{% endif %}{% if http_response.cond is defined %} {{ http_response.cond }}{% endif %} - -{% endfor %} - {% for tcp_request_inspect_delay in frontend.tcp_request_inspect_delay | default([]) %} tcp-request inspect-delay {{ tcp_request_inspect_delay.timeout }} @@ -81,6 +71,16 @@ frontend {{ frontend.name }} {% endfor %} +{% for http_request in frontend.http_request | default([]) %} + http-request {{ http_request.action }}{% if http_request.param is defined %} {{ http_request.param }}{% endif %}{% if http_request.cond is defined %} {{ http_request.cond }}{% endif %} + +{% endfor %} + +{% for http_response in frontend.http_response | default([]) %} + http-response {{ http_response.action }}{% if http_response.param is defined %} {{ http_response.param }}{% endif %}{% if http_response.cond is defined %} {{ http_response.cond }}{% endif %} + +{% endfor %} + {% for action in ['reqadd', 'rspadd'] %} {% for params in frontend[action] | default([]) %} {{ action }} {{ params.string }}{% if params.cond is defined %} {{ params.cond }}{% endif %} diff --git a/templates/etc/haproxy/listen.cfg.j2 b/templates/etc/haproxy/listen.cfg.j2 index f3b9e301..1366dfe2 100644 --- a/templates/etc/haproxy/listen.cfg.j2 +++ b/templates/etc/haproxy/listen.cfg.j2 @@ -84,11 +84,6 @@ listen {{ listen.name }} {% endif %} {% endif %} -{% for http_request in listen.http_request | default([]) %} - http-request {{ http_request.action }}{% if http_request.param is defined %} {{ http_request.param }}{% endif %}{% if http_request.cond is defined %} {{ http_request.cond }}{% endif %} - -{% endfor %} - {% for tcp_request_inspect_delay in listen.tcp_request_inspect_delay | default([]) %} tcp-request inspect-delay {{ tcp_request_inspect_delay.timeout }} @@ -109,6 +104,11 @@ listen {{ listen.name }} {% endfor %} +{% for http_request in listen.http_request | default([]) %} + http-request {{ http_request.action }}{% if http_request.param is defined %} {{ http_request.param }}{% endif %}{% if http_request.cond is defined %} {{ http_request.cond }}{% endif %} + +{% endfor %} + {% for http_response in listen.http_response | default([]) %} http-response {{ http_response.action }}{% if http_response.param is defined %} {{ http_response.param }}{% endif %}{% if http_response.cond is defined %} {{ http_response.cond }}{% endif %}