Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Find exact client IP using mod_reverseproxy  (Read 2161 times)

0 Members and 1 Guest are viewing this topic.

jominj

  • Guest
Find exact client IP using mod_reverseproxy
« on: March 19, 2014, 10:48:54 pm »
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.
  • Installation
Code: [Select]
#wget https://raw.github.com/Prajithp/mod_reverseproxy/master/mod_reverseproxy.c
          #apxs -i -c -n mod_reverseproxy.so mod_reverseproxy.c 
  • Configuration Directives
Code: [Select]
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 configuration
Code: [Select]
LoadModule 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>