ansible-ffibk/roles/service-fastd-mesh/templates/fastd_exporter_vhost.conf.j2
2019-05-22 09:18:40 +02:00

24 lines
916 B
Django/Jinja

server {
listen {{ lookup('dig', inventory_hostname, 'qtype=A') }}:9281 ssl;
listen [{{ lookup('dig', inventory_hostname, 'qtype=AAAA') }}]:9281 ssl;
server_name {{ inventory_hostname_short }}.{{ http_domain_external }} {{ inventory_hostname_short }}.{{ http_domain_internal }};
ssl_certificate /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/{{ inventory_hostname_short }}.{{ http_domain_external }}/privkey.pem;
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
location / {
proxy_pass http://127.0.0.1:9281;
allow 127.0.0.0/8;
allow ::1/128;
{% for group in ['monitoring', 'gateways'] %}
{% for host in groups[group] %}
allow {{ lookup('dig', host, 'qtype=A') }};
allow {{ lookup('dig', host, 'qtype=AAAA') }};
{% endfor %}
{% endfor %}
deny all;
}
}