Support several binds in frontend
Change-Id: I61537607bb82cb2069ffaa51634766017ba61760
diff --git a/haproxy/files/haproxy.cfg b/haproxy/files/haproxy.cfg
index 55b96d3..6d0392a 100644
--- a/haproxy/files/haproxy.cfg
+++ b/haproxy/files/haproxy.cfg
@@ -206,9 +206,10 @@
{%- if listen.get('format', 'listen') == 'end' %}
frontend {{ listen_name }}
- bind {{ listen.binds[0].address }}:{{ listen.binds[0].port }}
- {% if listen.binds[0].get('ssl', {}).enabled|default(False) %}
- bind {{ listen.binds[0].address }}:{{ listen.binds[0].ssl_port|default('443') }} {% if listen.binds[0].ssl.pem_file is defined %}ssl crt {{ listen.binds[0].ssl.pem_file }}{% else %}ssl crt /etc/haproxy/ssl/{{ listen_name }}{% endif %}
+ {%- for bind in listen.binds %}
+ bind {{ bind.address }}:{{ bind.port }} {% if bind.get('ssl', {}).enabled|default(False) %} {% if bind.ssl.pem_file is defined %}ssl crt {{ bind.ssl.pem_file }}{% else %}ssl crt /etc/haproxy/ssl/{{ listen_name }}{% endif %} {% endif %}
+ {% endfor %}
+ {% if listen.get('force_ssl') == true %}
redirect scheme https code 301 if !{ ssl_fc }
{% endif %}
{%- for redirect in listen.get('redirects', []) %}