Feature #6374
closed
Feature #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
Added by Marc Dye over 8 years ago.
Updated over 7 years ago.
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
- Target version changed from 2.3.2 to 2.4.0
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.
- Assignee deleted (
Marc Dye)
- Assignee set to Jim Pingle
PHP Example:
<html><head><title>Current IP Check</title></head><body>Current IP Address: <?=$_SERVER['REMOTE_ADDR']?></body></html>
- Status changed from New to Feedback
- % Done changed from 0 to 100
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.
- 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.
Also available in: Atom
PDF