diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 21b83addf..7e9c221cf 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -171,59 +171,44 @@ # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr' %} +{% do acl_options.append('hdr(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.hdr|default("") != "" %} -{% do acl_options.append('hdr(host)') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.hdr) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_beg' %} +{% do acl_options.append('hdr_beg(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.hdr_beg|default("") != "" %} -{% do acl_options.append('hdr_beg(host)') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.hdr_beg) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_end' %} +{% do acl_options.append('hdr_end(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.hdr_end|default("") != "" %} -{% do acl_options.append('hdr_end(host)') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.hdr_end) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_reg' %} +{% do acl_options.append('hdr_reg(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.hdr_reg|default("") != "" %} -{% do acl_options.append('hdr_reg(host)') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.hdr_reg) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_sub' %} +{% do acl_options.append('hdr_sub(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.hdr_sub|default("") != "" %} -{% do acl_options.append('hdr_sub(host)') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.hdr_sub) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'http_auth' %} {% if acl_data.allowedUsers|default("") != "" or acl_data.allowedGroups|default("") != "" %} @@ -253,70 +238,52 @@ # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path' %} +{% do acl_options.append('path') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.path|default("") != "" %} -{% do acl_options.append('path') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.path) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_beg' %} +{% do acl_options.append('path_beg') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.path_beg|default("") != "" %} -{% do acl_options.append('path_beg') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.path_beg) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_dir' %} +{% do acl_options.append('path_dir') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.path_dur|default("") != "" %} -{% do acl_options.append('path_dir') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.path_dir) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_end' %} +{% do acl_options.append('path_end') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.path_end|default("") != "" %} -{% do acl_options.append('path_end') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.path_end) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_reg' %} +{% do acl_options.append('path_reg') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.path_reg|default("") != "" %} -{% do acl_options.append('path_reg') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.path_reg) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_sub' %} +{% do acl_options.append('path_sub') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} {% if acl_data.path_sub|default("") != "" %} -{% do acl_options.append('path_sub') %} -{% if acl_data.caseSensitive|default('0') == '0' %} -{% do acl_options.append('-i') %} -{% endif %} {% do acl_options.append(acl_data.path_sub) %} -{% else %} -{% set acl_enabled = '0' %} - # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'sc_bytes_in_rate' %} {% if acl_data.sc_number|default("") != "" and acl_data.sc_bytes_in_rate|default("") != "" %}