2017-10-27 11:38:02 +02:00
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
2018-02-28 06:15:43 +01:00
|
|
|
listen [::]:80 default_server;
|
2017-10-27 11:38:02 +02:00
|
|
|
server_name _;
|
|
|
|
|
|
|
|
charset utf-8;
|
|
|
|
server_tokens off;
|
|
|
|
|
2018-06-15 09:04:33 +02:00
|
|
|
include /etc/nginx/snippets/letsencrypt-acme-challenge.conf;
|
|
|
|
|
|
|
|
root /var/www/html;
|
|
|
|
location / {
|
|
|
|
index index.html;
|
|
|
|
autoindex on;
|
|
|
|
autoindex_exact_size off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 443 ssl default_server;
|
|
|
|
listen [::]:443 ssl default_server;
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
charset utf-8;
|
|
|
|
server_tokens off;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2017-10-27 11:38:02 +02:00
|
|
|
root /var/www/html;
|
|
|
|
location / {
|
|
|
|
index index.html;
|
2017-10-29 21:24:48 +01:00
|
|
|
autoindex on;
|
|
|
|
autoindex_exact_size off;
|
2017-10-27 11:38:02 +02:00
|
|
|
}
|
2018-09-11 13:49:03 +02:00
|
|
|
|
2018-09-14 13:11:14 +02:00
|
|
|
{% if node_exporter_present is defined %}
|
2018-09-11 13:49:03 +02:00
|
|
|
location ^~ /metrics {
|
|
|
|
set $metric_addr 127.0.0.1;
|
|
|
|
proxy_pass http://$metric_addr:9100/metrics;
|
|
|
|
|
|
|
|
allow 127.0.0.0/8;
|
|
|
|
allow ::1/128;
|
|
|
|
{% for host in groups['ffmwu-monitoring'] %}
|
|
|
|
allow {{ lookup('dig', host, 'qtype=A') }};
|
|
|
|
allow {{ lookup('dig', host, 'qtype=AAAA') }};
|
|
|
|
deny all;
|
|
|
|
{% endfor %}
|
|
|
|
}
|
2018-09-20 11:28:04 +02:00
|
|
|
{% endif %}
|
2017-10-27 11:38:02 +02:00
|
|
|
}
|