If you are using the mod_remoteip with Apache and the user using a proxy to access the server then we won't be able to get exact client IP address. To solve this problem we can use the mod_reverseproxy.
#wget https://raw.github.com/Prajithp/mod_reverseproxy/master/mod_reverseproxy.c
#apxs -i -c -n mod_reverseproxy.so mod_reverseproxy.c
ReverseProxyEnable (On|Off) - Enable reverse proxy
ReverseProxyRemoteIPHeader X-Real-IP - The header to use for the real IP
address.
ReverseProxyRemoteIPTrusted 127.0.0.1 - What IPs to adjust requests for
example configurationLoadModule reverseproxy_module modules/mod_reverseproxy.so
<IfModule reverseproxy_module>
ReverseProxyEnable On
ReverseProxyRemoteIPHeader X-Real-IP
ReverseProxyRemoteIPTrusted 127.0.0.1
ReverseProxyRemoteIPTrusted xx.xx.xx.xx
</IfModule>