can you add the code listed by cloudflare to make it run better with varnish?

sub vcl_recv {
  #cloudflare
  remove req.http.X-Forwarded-For;
  if (req.http.cf-connecting-ip) {
    set req.http.X-Forwarded-For = req.http.cf-connecting-ip;
  } else {
    set req.http.X-Forwarded-For = client.ip;
  }
  ...
}

Varnish Cache

Comments

SolomonGifford’s picture

Component: Code » Documentation
Status: Active » Closed (works as designed)

This is in the instructions on the main page:

Instructions:
Make sure you add the following to your settings.php:

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

Drupal already looks at X-Forwarded-For:
http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/ip_ad...