vhost: Add support for matching by query
This commit is contained in:
@@ -247,6 +247,26 @@ argument_specs:
|
|||||||
type: dict
|
type: dict
|
||||||
required: false
|
required: false
|
||||||
default: {}
|
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:
|
||||||
type: str
|
type: str
|
||||||
@@ -655,6 +675,26 @@ argument_specs:
|
|||||||
type: dict
|
type: dict
|
||||||
required: false
|
required: false
|
||||||
default: {}
|
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:
|
||||||
type: str
|
type: str
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
{% for matcher in location.matchers %}
|
{% for matcher in location.matchers %}
|
||||||
{% if matcher.name != '' %}
|
{% if matcher.name != '' %}
|
||||||
@{{ 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 %}
|
{% if matcher.match_methods | default([]) | length > 0 %}
|
||||||
method {{ matcher.match_methods | join(' ') }}
|
method {{ matcher.match_methods | join(' ') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
_vhost_matcher_defaults:
|
_vhost_matcher_defaults:
|
||||||
match_headers: {}
|
match_headers: {}
|
||||||
match_methods: []
|
match_methods: []
|
||||||
|
match_query: []
|
||||||
_vhost_matchers: >-
|
_vhost_matchers: >-
|
||||||
{{
|
{{
|
||||||
vhost_matchers
|
vhost_matchers
|
||||||
|
|||||||
Reference in New Issue
Block a user