Originally posted here by stanger
you have to request the following variable:
"HTTP_X_FORWARDED_FOR"
This is correct. I'm not sure if you can set up your web server to log this for you, but you can certainly log it yourself in your own code. Also note that some transparent proxies use the "HTTP_CLIENT_IP" header.

Finally, you'll be able to log this and act on it, but that will probably just cause these troublemakers to use opaque proxies.