Skip to content

Commit

Permalink
Provide info on services_checkip.php about what the server must retur…
Browse files Browse the repository at this point in the history
…n, and provide two examples of server-side code to return the client address. Fixes #6374
  • Loading branch information
jim-p committed Feb 2, 2017
1 parent d2a2f01 commit 186c7a6
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/usr/local/www/services_checkip.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,32 @@
</nav>

<div class="infoblock">
<?php print_info_box(gettext(
<?php print_info_box(gettext('The server must return the client IP address ' .
'as a string in the following format: ') .
'<pre>Current IP Address: x.x.x.x</pre>' .
gettext(
'The first (highest in list) enabled check ip service will be used to ' .
'check IP addresses for Dynamic DNS services, and ' .
'RFC 2136 entries that have the "Use public IP" option enabled.'
), 'info', false); ?>
'RFC 2136 entries that have the "Use public IP" option enabled.') .
'<br/><br/>'
, 'info', false);

print_info_box(gettext('Sample Server Configurations') .
'<br/>' .
gettext('nginx with LUA') . ':' .
'<pre> location = /ip {
default_type text/html;
content_by_lua \'
ngx.say("' . htmlspecialchars('<html><head><title>Current IP Check</title></head><body>') . 'Current IP Address: ")
ngx.say(ngx.var.remote_addr)
ngx.say("' . htmlspecialchars('</body></html>') . '")
\';
}</pre>' .
gettext('PHP') .
'<pre>' .
htmlspecialchars('<html><head><title>Current IP Check</title></head><body>Current IP Address: <?=$_SERVER[\'REMOTE_ADDR\']?></body></html>') .
'</pre>'
, 'info', false); ?>
</div>

<?php include("foot.inc");

0 comments on commit 186c7a6

Please sign in to comment.