vhost: fix defaults for matchers

This commit is contained in:
uumas
2025-11-22 05:55:56 +02:00
parent d8bd645a80
commit c151a2ee0c
2 changed files with 5 additions and 5 deletions

View File

@@ -7,13 +7,13 @@
{% else %} {% else %}
handle { handle {
{% endif %} {% endif %}
{% for matcher in location.matchers %} {% for matcher in location.matchers %}
{% if matcher.name != '' %} {% if matcher.name != '' %}
@{{ matcher.name }} { @{{ matcher.name }} {
{% if matcher.match_methods | length > 0 %} {% if matcher.match_methods | default([]) | length > 0 %}
method {{ matcher.match_methods | join(' ') }} method {{ matcher.match_methods | join(' ') }}
{% endif %} {% endif %}
{% for header in matcher.match_headers | dict2items %} {% for header in matcher.match_headers | default({}) | dict2items %}
header{{ '_regexp' if header.value.startswith('^') and header.value.endswith('$') else '' }} {{ header.key }} {{ header.value }} header{{ '_regexp' if header.value.startswith('^') and header.value.endswith('$') else '' }} {{ header.key }} {{ header.value }}
{% endfor %} {% endfor %}
} }
@@ -79,7 +79,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
} }
{% endfor %} {% endfor %}
} }
{% endfor %} {% endfor %}
} }

View File

@@ -1,7 +1,7 @@
--- ---
_vhost_matcher_defaults: _vhost_matcher_defaults:
match_headers: {} match_headers: {}
match_method: [] match_methods: []
_vhost_matchers: >- _vhost_matchers: >-
{{ {{
vhost_matchers vhost_matchers