Created
June 17, 2013 20:32
-
-
Save bithive/5800101 to your computer and use it in GitHub Desktop.
Perl module for nginx which displays the value of REMOTE_ADDR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ip; | |
use nginx; | |
sub handler { | |
my $r = shift; | |
my $ip = $r->remote_addr; | |
$r->send_http_header("text/html"); | |
$reply = <<END; | |
<html> | |
<head> | |
<meta name="googlebot" content="noindex"/> | |
<title>$ip</title> | |
<style type="text/css"> | |
td { font-size: 5em; } | |
</style> | |
</head> | |
<body> | |
<table width="100%" height="100%"> | |
<tr><td align="center" valign="middle">$ip</td></tr> | |
</table> | |
</body> | |
</html> | |
END | |
$r->print($reply); | |
$r->rflush; | |
return OK; | |
} | |
1; | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment