It's great to have services like this.
For the benefit of anyone interested: for a "self-hosted" solution, you can do this entirely within Nginx. Here's an example config:
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 default_server;
listen [::]:443 default_server;
# Use Letsencrypt for SSL. This part will depend on your own setup.
ssl_certificate /etc/letsencrypt/live/<my domain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<my domain>/privkey.pem;
server_name <my domain>;
# Deny all access at all paths; useful if you're hosting other stuff behind
# the same Nginx server (e.g. reverse proxy)
location / {
deny all;
}
# At /ip, return 200 with the client IP address in the body
location = /ip {
default_type text/plain;
return 200 '$remote_addr';
}
}
replies(7):