d8-contrib-modules / cloudflare

Cloudflare Module for Drupal
16 stars 14 forks source link

Return the correct client IP #27

Closed victorcpereira closed 9 years ago

victorcpereira commented 9 years ago

Hey. I use Drupal 8 + Acquia + CloudFlare. I want to set up the reverse proxy on my website, to return the correct client IP.

I changed the settings.php as follows.

$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER ['REMOTE_ADDR']);

But the function \Drupal::request()->getClientIp() keeps returning the CloudFlare IP, instead of the client ip.

How can I set up Drupal 8 + Acquia + CloudFlare to return the correct client IP?

aweingarten commented 9 years ago

@victorcpereira thanks for looking at the module, and taking the time to create an issue. Its still in a state of rapid development and change.

This issue is already documented here: https://github.com/d8-contrib-modules/cloudflare/issues/23

It's not hard, just a question of time. If you are interested I would welcome a PR. It should be pretty easy.