• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Cloudways Report Real IP Reporting

Cloudways Report Real IP Reporting 5 years 7 months ago #39487

  • jimhill10
  • jimhill10's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 5
I found that when we used the previous code post mentioned in these forums to return the real IP for visitors it produced a double result, first the xx.xx.xx.xx IP address, then another value ",127.0.0.1" when running on a Cloudways droplet. I found this code online, but it produces a blank result for the IP address. Does anyone have an idea on what code to use to extract the Real IP? Our config is complicated because we are behind the Sucuri proxy.

//<code>
if ( isset( $_SERVER[ “HTTP_CF_CONNECTING_IP” ] ) ) {
$_SERVER[‘REMOTE_ADDR’] = $_SERVER[“HTTP_CF_CONNECTING_IP”];
}
//</code>

Creates a blank result.

The prior value created the bad result:
//<code>
if ( isset( $_SERVER[ "HTTP_X_FORWARDED_FOR" ] ) ) {
$_SERVER[ 'REMOTE_ADDR' ] = $_SERVER[ "HTTP_X_FORWARDED_FOR" ];
}
return $_SERVER["REMOTE_ADDR"];
//</code>
Jim Hill
Last Edit: 5 years 7 months ago by jimhill10. Reason: My code did not work, I need help. Reposted as a question.
The administrator has disabled public write access.

Cloudways Report Real IP Reporting 5 years 7 months ago #39488

  • jimhill10
  • jimhill10's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 5
I talked to Cloudways. I tried going back to the standard script value of {global:userip} and it works now.
Jim Hill
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!