use a list for nginx_error_location
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-05-25 11:22:18 +02:00
parent 08813acac8
commit 21bd776e75
2 changed files with 14 additions and 14 deletions

View File

@ -107,17 +107,17 @@ nginx_error_page: []
# dest: /4xx.html
# @end
nginx_error_location: []
# @var nginx_error_location: description: >
# Default error location. If set, the defined location will be automatically added once
# to every server block to handle custom error sites.
# @end
# @var nginx_error_location:default: $ "_unset_"
# @var nginx_error_location: example: >
# nginx_error_location:
# match: /
# root: /var/www/vhosts/default
# index: index.html
# custom_options:
# - match: /
# root: /var/www/vhosts/default
# index: index.html
# custom_options:
# @end
nginx_vhosts_dir: /var/www/vhosts

View File

@ -90,22 +90,22 @@ server {
{% endfor %}
{% endif %}
{% if nginx_error_location is defined %}
location {{ nginx_error_location.match }} {
{% if nginx_error_location.root is defined and nginx_error_location.root %}
root {{ nginx_error_location.root }};
{% for error_location in nginx_error_location %}
location {{ error_location.match }} {
{% if error_location.root is defined and error_location.root %}
root {{ error_location.root }};
{% endif %}
{% if nginx_error_location.index is defined and nginx_error_location.index %}
index {{ nginx_error_location.index }};
{% if error_location.index is defined and error_location.index %}
index {{ error_location.index }};
{% endif %}
{% if nginx_error_location.custom_options is defined and nginx_error_location.custom_options %}
{% if error_location.custom_options is defined and error_location.custom_options %}
{% for inline_option in nginx_error_location.custom_options %}
{% for inline_option in error_location.custom_options %}
{{ inline_option }};
{% endfor %}
{% endif %}
}
{% endif %}
{% endfor %}
}
{% endfor %}