ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

multiple servers load balanced set up

December 06, 2010 2:01pm

Subscribe [2]
  • #1 / Dec 06, 2010 2:01pm

    wearepapertiger

    13 posts

    We have 3 web servers running a site with 1 primary server acting as the db/file sys with varnish installed on the front facing servers, and we need to be able to pull the x-forwarded-for headers in as all of our internal tracking and 3rd party plugins are resolving to the individual web head IPs instead of the client IPs…
    see these articles

    http://en.wikipedia.org/wiki/X-Forwarded-For
    http://devcentral.f5.com/weblogs/macvittie/archive/2008/06/02/3323.aspx

    the second one in particular seems to describe the method we need to instantiate:

    “If you’re like me, you might have written an application or site in PHP and for some reason you want the real client IP address, not the proxy IP address…I still need to access that value from my code so I can store it in the database.

    $headers = apache_request_headers();
    $real_client_ip = $headers[“X-Forwarded-For”];”

    Is there a value in EE I can adjust?  Or does anyone have any experience with this?

  • #2 / Dec 07, 2010 2:50am

    John Henry Donovan

    12339 posts

    wearepapertiger,

    Take a look in your system/expressionengine/config/config.php file near the bottom

    /*
    |--------------------------------------------------------------------------
    | Reverse Proxy IPs
    |--------------------------------------------------------------------------
    |
    | If your server is behind a reverse proxy, you must whitelist the proxy IP
    | addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
    | header in order to properly identify the visitor's IP address.
    | Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
    |
    */
    $config['proxy_ips'] = "";
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases