In a situation where Apache is sitting behind a reverse proxy (such as Squid), the cgi environment variable REMOTE_ADDR gets the address of the proxy rather tha
REMOTE_ADDR
You can install the module mod_extract_forwarded and set MEFaccept parameter to all.