26 lines
826 B
Django/Jinja
26 lines
826 B
Django/Jinja
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 %}
|
|
server_name [{{ unicastv6 }}];
|
|
{% endif %}
|
|
|
|
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' %}
|
|
}
|
|
}
|