diff --git a/roles/service-nginx/templates/default.conf.j2 b/roles/service-nginx/templates/default.conf.j2 index fdaff8a..db53d44 100644 --- a/roles/service-nginx/templates/default.conf.j2 +++ b/roles/service-nginx/templates/default.conf.j2 @@ -36,6 +36,7 @@ server { autoindex_exact_size off; } +{% if node_exporter_present is defined %} location ^~ /metrics { set $metric_addr 127.0.0.1; proxy_pass http://$metric_addr:9100/metrics; @@ -47,5 +48,6 @@ server { allow {{ lookup('dig', host, 'qtype=AAAA') }}; deny all; {% endfor %} +{% endif %} } }