vhost: Add support for specifying preserve query independently of
preserve path
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
request_header -{{ header }}
|
||||
{% endfor %}
|
||||
{% elif location.type == 'redirect' %}
|
||||
redir {{ location.redirect_target }}{{ '{uri}' if location.redirect_preserve_path }} {{ location.redirect_type }}
|
||||
redir * {{ location.redirect_target }}{{ '{path}' if location.redirect_preserve_path }}{{ '?{query}' if location.redirect_preserve_query }} {{ location.redirect_type }}
|
||||
{% elif location.type == 'respond' %}
|
||||
{% if location.respond_content_type == 'json' %}
|
||||
respond `{{ location.respond_content | to_json }}`
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
'redirect_target': item.redirect_target | default(vhost_redirect_target if vhost_type == 'redirect' else ''),
|
||||
'redirect_preserve_path': item.redirect_preserve_path | default(vhost_redirect_preserve_path),
|
||||
'redirect_preserve_query': item.redirect_preserve_query | default(vhost_redirect_preserve_query),
|
||||
'redirect_type': item.redirect_type | default(vhost_redirect_type),
|
||||
|
||||
'respond_content': item.respond_content | default(vhost_respond_content if vhost_type == 'respond' else ''),
|
||||
|
||||
Reference in New Issue
Block a user