If you've found this page and are looking for restoring your visitor IP's / REMOTE_ADDR and are using Apache take a look at mod_cloudflare for doing everything you need automatically as far as I know. If you still need to restore your REMOTE_ADDR then scroll down.
Cloudflare is a fantastic service available from free. It offers a nice bunch of tools to make your site faster via their CDN network and more secure through their various protection measures and SSL. It does this by passing the majority of traffic (depending on your DNS settings) to your site through proxies within their network, caching static content and serving it from the best location according to where your users are globally. This means you can offer a great serving of your web content to anyone around the globe without the worry of different load-times etc.
Unfortunately there is a small annoying issue if your website / service uses visitor IP's in order to determine specific actions or record vital stats. All requests coming into your website are reverse proxied, therefore only cloudflares IP address ranges will show up in your logs instead of the visitor IP.
Gather uses nginx for most of its live services (better scalability than Apache). Unfortunately there isn't a mod_cloudflare available, instead nginx has a very cool module called http-real-ip. This module allows you to specify a range of IP addresses along with a header which can map the original visitor IP back into your request.
Whenever a request is sent to your site via Cloudflare, the original IP address will be included in the X-Forwarded-For header and/or CF-Connecting-IP header. If you don't use any other proxies on your site use the latter.
Depeding on your setup, insert the following into your nginx configuration.
Note that this is valid within http, server, location contexts, so if you're on a shared host this should not matter.
Restart/reload nginx and your IP's will now be your visitors original IP.
FIXING PHP /
Next if you're doing anything fancy with PHP and wish to check the visitor IP, whilst keeping support for when you turn off Cloudflare, place the following code somewhere in your PHP startup. i.e for Wordpress a good place to put this would be at the start of your config.php file.