twarne / xebia-france

Automatically exported from code.google.com/p/xebia-france
0 stars 0 forks source link

Tomcat 6.0.13 is not getting Client Ip, Its supplying Load balancer IP address #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Tomcat 6.0.13 is the Container, I am using with IIS and windows 2003 server. 
which is hosted behind Load Balancer.
2.In the application, I am using request.getRemoteAddr() 
Its returing Ip address of the Load Balancer instead of Client IP.
3.

What is the expected output? What do you see instead?
I need to get the Client IP for authorization.  

What version of the product are you using? On what operating system?
Tomcat 6.0.13, windows 2003 server with IIS server

Please provide any additional information below.

Original issue reported on code.google.com by naveenk....@gmail.com on 23 Jun 2011 at 8:01

GoogleCodeExporter commented 9 years ago
Hello,

Do you use XForwardedForFilter or RemoteIpValve ? Which version of the library ?

Can you provide the configuration fragment ?

Can you enable the logs ? 
* if this is the filter in your webapp, please enable logs on 
fr.xebia.servlet.filter.XForwardedFilter .
* if the is the valve, please enable 
org.apache.catalina.connector.RemoteIpValve with
  "org.apache.catalina.connector.RemoteIpValve.level = FINE" in $catalina_home/conf/logging.properties

Original comment by cyri...@cyrilleleclerc.com on 23 Jun 2011 at 9:04

GoogleCodeExporter commented 9 years ago
Hi,

I am using xebia-tomcat-extras-1.0.0.
I copied this jar in the TOMCAT_HOME/lib and I added configuration in 
server.xml as

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true"   
 xmlValidation="false" xmlNamespaceAware="false">

<Valve className="org.apache.catalina.connector.RemoteIpValve" 
remoteIPHeader="X-Client-IP" />

</Host>

Is there any other things that I need to do??

Original comment by naveenk....@gmail.com on 23 Jun 2011 at 9:13

GoogleCodeExporter commented 9 years ago

Original comment by cyri...@cyrilleleclerc.com on 8 Dec 2012 at 2:44