Web server behind proxy

7 years 10 months ago #1 by tmangan
My hosting provider is using a proxy server (CloudFlare), which affects IP Mapping. Basically, without a change to the code all IP addresses collected point to the proxy server and not the end user.

Basically, I can resolve by changing references to:
//$ip = $_SERVER;
$ip = JFactory::getApplication()->input->server->get('HTTP_X_FORWARDED_FOR','');

in both the agent module and component files. A better solution would be to add this as a configurable feature and an if block in these two locations.

Please Log in or Create an account to join the conversation.

7 years 10 months ago #2 by geoffc
Replied by geoffc on topic Web server behind proxy
CloudFlare acts as a reverse proxy, when it's configured as expected, so all connections to your origin webserver come from CloudFlare's IP addresses which is the behaviour you are seeing.

As you have correctly identified CloudFlare does follow industry standards and includes the visitor's IP address in the X-Forwarded-For header. They also have a CF-Connecting-IP header that could also possibly be used, but this is CloudFlare specific.

I will look to include it as an option in the configuration for the next released version as you have suggested.

Regards
Geoff

Please Log in or Create an account to join the conversation.

7 years 10 months ago - 7 years 10 months ago #3 by geoffc
Replied by geoffc on topic Web server behind proxy
Currently testing a modified version of the component.

One thing I forgot to mention but which should be added is that Cloudflare themselves produce a plugin (available on the JED) that is intended to send the correct IP address. Not tried it myself but was aware of its existence.

I still consider the change valid since it is likely that other CDN's than Cloudflare may be in use by some sites and the modification would equally apply in those situations.

Update: Code written and being tested. Confirmation by client is awaited but will be delayed a while since they are currently away.

Regards
Geoff

Please Log in or Create an account to join the conversation.

7 years 9 months ago #4 by chrisc
Replied by chrisc on topic Web server behind proxy
User has confirmed that the RC works behind Cloudflare. Release expected shortly.

Regards

If you are using our extensions please leave a review at the JED: IP Mapping | Issue Tracker | JAudit | Password Control

Please Log in or Create an account to join the conversation.

Time to create page: 0.166 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries