dn42-myip/nginx-site.j2

26 lines
818 B
Text
Raw Normal View History

2024-11-20 23:31:57 +00:00
server {
listen [fd32:6b0:70a6:8181::81]:80;
{% if unicastv6 is defined %}
listen [{{ unicastv6 }}]:80;
{% endif %}
server_name myip.9pfs.dn42;
server_name *.myip.9pfs.dn42;
server_name [fd32:6b0:70a6:8181::81];
{% if unicastv6 is defined %}
listen [{{ unicastv6 }}];
location = /raw {
return 200 '$remote_addr\n';
default_type text/plain;
}
location = /api {
default_type application/json;
add_header 'Access-Control-Allow-Origin' '*';
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}';
}
location = / {
{% include 'nginx-html.j2' %}
}
}