UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is online
Our support specialists is available now. We will attend to you as soon as we can.
  Support is online

Support retrieving IP Location (Members Map) for site behind CDN

Dreamonde Limited / Alfred Tang · ·
12:15 PM Friday, 18 April 2014
None
Hi Team,

Member's Map is a great feature to understand their member's location (from backend - ES dashboard) visually. However, I found this doesn't work while "fronting" the website "behind" a CDN, such as Cloudflare. Not sure if your team have any roadmap to support this in future? I know Cloudflare will supply the IP via HTTP_CF_CONNECTING_IP header; and may fix all siteowner's still can view their member's map correctly behind CDN or at least Cloudflare.

If this is not your interest, maybe can somebody guide me where to modify to implement below codes (or your codes) for ES to retrieve correct IP location behind CDN services.

At least I will try this today myself and see if I can do something via the fixing webserver, and share the result (if possible to avoid modifying ES):
https://support.cloudflare.com/hc/en-us/articles/200170916-Why-should-I-install-mod-cloudflare-
https://support.cloudflare.com/hc/en-us/articles/200170836-How-do-I-restore-original-visitor-IP-to-Apache-Web-Servers-

I have some sharing from internet and this may shorten your development time just in case.

Add this line to your file:

PHP Code:
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];

From what I've *read*, Cloudflare passes the original users' IP address via the HTTP_CF_CONNECTING_IP header, so that should fix it.

That said, I quickly tried setting it up on one of my own domains and didn't see the header that I expected.

Still, give it a go and let me know. It won't cause any problems if it doesn't work.


Thanks

Best regards,
Alfred / Dreamonde
The replies under this section are restricted to logged in users or users with an active subscription with us