This module adds the possibility to respond to a certain URL simply with the remote IP address, e.g.:
# curl http://ip.mydomain.tld/
123.123.123.123
To include this module in your nginx-installation either do:
./configure --add-module=/path/to/ngx_remote_ip-0.1/
or in Gentoo simple add this to your /etc/make.profile
:
NGINX_ADD_MODULES="/path/to/ngx_remote_ip-0.1/"
Simply add a new server-declaration:
server {
listen 80;
server_name ip.mydomain.tld;
location / {
remote_ip;
}
}
Thanks to Evan Miller for his guide: http://www.evanmiller.org/nginx-modules-guide.html This module is heavily based upon it.