mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Fix frontend without SSL&certificate after one with SSL&certificate
Fix SSL enable with SSL check-box unchecked
This commit is contained in:
@@ -531,25 +531,27 @@ defaults
|
||||
|
||||
{% if helpers.exists('OPNsense.HAProxy.frontends') %}
|
||||
{% for frontend in helpers.toList('OPNsense.HAProxy.frontends.frontend') %}
|
||||
{% if frontend.enabled=='1' %}
|
||||
{% if frontend.enabled == '1' %}
|
||||
# Frontend: {{frontend.name}} ({{frontend.description}})
|
||||
frontend {{frontend.name}}
|
||||
{# # collect ssl certs (if configured) #}
|
||||
{% if frontend.ssl_certificates|default("") != "" %}
|
||||
{% set ssl_certs = [] %}
|
||||
{% for cert in frontend.ssl_certificates.split(",") %}
|
||||
{% do ssl_certs.append('crt /var/etc/haproxy/ssl/' ~ cert ~ '.pem') %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{# # advanced ssl options #}
|
||||
{% if frontend.ssl_customOptions|default("") != "" %}
|
||||
{# # add a space to separate it from other ssl params #}
|
||||
{% set ssl_options = frontend.ssl_customOptions ~ ' ' %}
|
||||
{% if frontend.ssl_enabled == '1' %}
|
||||
{# # collect ssl certs (if configured) #}
|
||||
{% if frontend.ssl_certificates|default("") != "" %}
|
||||
{% set ssl_certs = [] %}
|
||||
{% for cert in frontend.ssl_certificates.split(",") %}
|
||||
{% do ssl_certs.append('crt /var/etc/haproxy/ssl/' ~ cert ~ '.pem') %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{# # advanced ssl options #}
|
||||
{% if frontend.ssl_customOptions|default("") != "" %}
|
||||
{# # add a space to separate it from other ssl params #}
|
||||
{% set ssl_options = frontend.ssl_customOptions ~ ' ' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{# # bind/listen configuration #}
|
||||
{% if frontend.bind|default("") != "" %}
|
||||
{% for bind in frontend.bind.split(",") %}
|
||||
bind {{bind}} name {{bind}} {% if ssl_certs|default("") != "" %}ssl {{ ssl_options }}{{ssl_certs|join(' ')}}{% endif %}
|
||||
bind {{bind}} name {{bind}} {% if frontend.ssl_enabled == '1' and ssl_certs|default("") != "" %}ssl {{ ssl_options }}{{ssl_certs|join(' ')}} {% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user