Ignore undefined values for autoindex and health check (#80)

* Ignore undefined autoindex

* ignore undefined health_check_plus
This commit is contained in:
Daniel Mills 2018-12-22 14:26:03 -08:00 committed by Alessandro Fael Garcia
parent c2cdc68ec3
commit dad58ec5cd

View File

@ -23,14 +23,14 @@ server {
listen {{ item.value.port }}; listen {{ item.value.port }};
{% endif %} {% endif %}
server_name {{ item.value.server_name }}; server_name {{ item.value.server_name }};
{% if item.value.autoindex %} {% if item.value.autoindex is defined and item.value.autoindex %}
autoindex on; autoindex on;
{% endif %} {% endif %}
{% if item.value.load_balancer is defined %} {% if item.value.load_balancer is defined %}
{% for location in item.value.load_balancer.locations %} {% for location in item.value.load_balancer.locations %}
location {{ item.value.load_balancer.locations[location].location }} { location {{ item.value.load_balancer.locations[location].location }} {
proxy_pass http://{{ item.value.load_balancer.locations[location].proxy_pass }}; proxy_pass http://{{ item.value.load_balancer.locations[location].proxy_pass }};
{% if item.value.load_balancer.health_check_plus %} {% if item.value.load_balancer.health_check_plus is defined and item.value.load_balancer.health_check_plus %}
health_check; health_check;
{% endif %} {% endif %}
proxy_set_header Host $host; proxy_set_header Host $host;