Compare commits
6 Commits
5630fbf927
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| fd57c7a9f2 | |||
| 79eed79546 | |||
| 4defbe5c31 | |||
| 9a67f67f08 | |||
| 751d0c1d97 | |||
| 496725662d |
@@ -3,6 +3,7 @@ Because any other "Whats my IP?"-tool sucks.
|
||||
|
||||
Try it here: https://ip.clerie.de
|
||||
|
||||
## About this software
|
||||
It's just one nginx site config. Feel free to host it yourself. It's open-source.
|
||||
|
||||
ip.clerie.de is the HTML page with some JavaScript. This page needs an A and AAAA record in DNS.
|
||||
@@ -10,3 +11,11 @@ ip.clerie.de is the HTML page with some JavaScript. This page needs an A and AAA
|
||||
ip4.clerie.de and ip6.clerie.de just returns the remote addr.
|
||||
|
||||
ip4.clerie.de has only an A record. ip6.clerie.de has only an AAAA record.
|
||||
|
||||
If you want host this yourself you have to replace all hardcoded domains. You can use the following sed command. Don't forget to change `.EXAMPLE.COM` to your own.
|
||||
|
||||
```
|
||||
sed -e '/git.clerie.de/!s/.clerie.de/.EXAMPLE.COM/g;' ip.clerie.de
|
||||
```
|
||||
|
||||
The first match is to exclude the line with the link to the git repo from replacing.
|
||||
|
||||
11
ip.clerie.de
11
ip.clerie.de
@@ -2,7 +2,7 @@ server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name ip.clerie.de ip4.clerie.de ip6.clerie.de;
|
||||
server_name ip.clerie.de;
|
||||
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ server {
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
location / {
|
||||
add_header Content-Type text/html;
|
||||
types { } default_type "text/html; charset=utf-8";
|
||||
return 200 '
|
||||
<html>
|
||||
<head>
|
||||
@@ -58,6 +58,7 @@ server {
|
||||
<li><b>IPv6:</b> <span id="ip6">Loading...</span></li>
|
||||
<li><b>IPv4:</b> <span id="ip4">Loading...</span></li>
|
||||
</ul>
|
||||
<p>Use bash and curl: <code>curl ip{4,6}.clerie.de</code></p>
|
||||
<p><small>Because any other "Whats my IP?"-tool sucks. <a href="https://git.clerie.de/clerie/ip.clerie.de">Host yourself :3</a></small></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -66,6 +67,8 @@ server {
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
listen [::]:443 ssl;
|
||||
listen 443 ssl;
|
||||
|
||||
@@ -77,8 +80,8 @@ server {
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
location / {
|
||||
add_header Content-Type text/plain;
|
||||
types { } default_type "text/plain; charset=utf-8";
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 $remote_addr;
|
||||
return 200 '$remote_addr\n';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user