2024-11-20 23:31:57 +00:00
server {
2024-12-31 05:10:50 +00:00
listen 172.20.0.81:80;
listen [fd42:d42:d42:81::1]:80;
2024-11-20 23:31:57 +00:00
listen [fd32:6b0:70a6:8181::81]:80;
2024-11-21 02:06:50 +00:00
{% if unicastv6 is defined %}
2024-11-20 23:31:57 +00:00
listen [{{ unicastv6 }}]:80;
2024-11-21 02:06:50 +00:00
{% endif %}
2024-11-20 23:31:57 +00:00
server_name myip.9pfs.dn42;
server_name *.myip.9pfs.dn42;
server_name [fd32:6b0:70a6:8181::81];
2024-12-31 05:10:50 +00:00
server_name 172.20.0.81;
server_name [fd42:d42:d42:81::1];
2024-11-21 02:06:50 +00:00
{% if unicastv6 is defined %}
server_name [{{ unicastv6 }}];
{% endif %}
2024-11-20 23:31:57 +00:00
location = /raw {
return 200 '$remote_addr\n';
default_type text/plain;
}
2024-11-21 02:06:50 +00:00
2024-11-20 23:31:57 +00:00
location = /api {
default_type application/json;
add_header 'Access-Control-Allow-Origin' '*';
2024-11-21 02:06:50 +00:00
return 200 '{\n\t"version": "1.0",\n\t"ip": "$remote_addr",\n\t"server": "$server_addr",\n\t"node_as": "4242422002",\n\t"node_location": "{% if country is defined %}{{ country }}{% else %}US{% endif %}",\n\t"node_id": "{% if fqdn is defined %}{{ fqdn }}{% else %}myip.9pfs.dn42{% endif %}"\n}';
2024-11-20 23:31:57 +00:00
}
location = / {
{% include 'nginx-html.j2' %}
}
}