Feature #6374
closedFeature #6373: RFC2136 DDNS could be more configurable to improve security
Provide sample server-side logic to report peer's IP address for use with DDNS
100%
Description
Pursuant to Issue #6373 -
We can help (our) users of DDNS by providing sample code which organizations could choose to deploy on trusted webservers. This code would simply report the IP address of the HTTP client host making the query. In addition, the HTTP response header could be adorned with the same information.
The sample code should be constructed so as to provide an ad-hoc definition of the required output.
Base case would be CGI logic for the prevalent open-source platforms (Linux & *BSD) running prevailing open-source webservers (Apache & nginx).
Files
Updated by Chris Buechler over 8 years ago
- Target version changed from 2.3.2 to 2.4.0
Updated by Jeremy Porter about 8 years ago
location = /ip { default_type text/html; content_by_lua ' ngx.say("<html><head><title>Current IP Check</title></head><body>Current IP Address: ") ngx.say(ngx.var.remote_addr) ngx.say("</body></html>") '; }
Requires nginx with
load_module /usr/local/libexec/nginx/ngx_http_lua_module.so;
Default freebsd nginx does not appear to have lua turned on in options, so it needs to be built from ports.
Updated by Jim Pingle almost 8 years ago
- Assignee set to Jim Pingle
PHP Example:
<html><head><title>Current IP Check</title></head><body>Current IP Address: <?=$_SERVER['REMOTE_ADDR']?></body></html>
Updated by Jim Pingle almost 8 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 186c7a6ca49af0d848c1082bfd7f6d9f0cde7046.
Updated by NOYB NOYB almost 8 years ago
- File CheckIP.php CheckIP.php added
There may potentially be a need to prevent caching too. Even if pfSense doesn't cache it, there could be CDN's such as Akamai in the path.
Attached is the PHP I've been using.
Updated by Jim Pingle almost 8 years ago
- Status changed from Feedback to Resolved
What's in the GUI is fine for the purpose it serves. No need to get that complicated for an example.