vhost: Add support for matching by query
This commit is contained in:
@@ -247,6 +247,26 @@ argument_specs:
|
||||
type: dict
|
||||
required: false
|
||||
default: {}
|
||||
match_query:
|
||||
description: Query to match
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
default: []
|
||||
options:
|
||||
key:
|
||||
description: Query key to match
|
||||
type: str
|
||||
required: true
|
||||
value:
|
||||
description: Query value to match. Matches any if unset.
|
||||
type: str
|
||||
required: false
|
||||
reverse:
|
||||
description: If true, matches request without matching key/value
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
|
||||
type:
|
||||
type: str
|
||||
@@ -655,6 +675,26 @@ argument_specs:
|
||||
type: dict
|
||||
required: false
|
||||
default: {}
|
||||
match_query:
|
||||
description: Query to match
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
default: []
|
||||
options:
|
||||
key:
|
||||
description: Query key to match
|
||||
type: str
|
||||
required: true
|
||||
value:
|
||||
description: Query value to match. Matches any if unset.
|
||||
type: str
|
||||
required: false
|
||||
reverse:
|
||||
description: If true, matches request without matching key/value
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
|
||||
type:
|
||||
type: str
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
{% for matcher in location.matchers %}
|
||||
{% if matcher.name != '' %}
|
||||
@{{ matcher.name }} {
|
||||
{% for query in matcher.match_query | default([]) %}
|
||||
{{ 'not ' if query.reverse else '' }}query {{ query.key }}={{ query.value | default('*') }}
|
||||
{% endfor %}
|
||||
{% if matcher.match_methods | default([]) | length > 0 %}
|
||||
method {{ matcher.match_methods | join(' ') }}
|
||||
{% endif %}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
_vhost_matcher_defaults:
|
||||
match_headers: {}
|
||||
match_methods: []
|
||||
match_query: []
|
||||
_vhost_matchers: >-
|
||||
{{
|
||||
vhost_matchers
|
||||
|
||||
Reference in New Issue
Block a user