List Info

Thread: request.getRemoteAddr() return null




request.getRemoteAddr() return null
country flaguser name
China
2007-09-26 20:51:51

Dear all,

Now Ive got a problem : two apache server(server1,and server2) and one tomcat server,  both of the apache server connet tomcat server with the same configuration(httpd.conf) , and connected by ProxyPass

But the problem is when I visit tomcat by apache server1, I can use request.getRemoteAddr() to get client Ip , but when I visit tomcat by apache server2 , request.getRemoteAddr() return null, I just dont know how could it happened!  

And I have also tried :

 

<%

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>getRemoteAddr=&quot;+request.getRemoteAddr());

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>getRemoteHost=&quot;+request.getRemoteHost());

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>Proxy-Client-IP=&quot;+request.getHeader("Proxy-Client-IP"));

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>WL-Proxy-Client-IP="+request.getHeader("WL-Proxy-Client-IP&quot;));

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>X-Forwarded-For=&quot;+request.getHeader("X-Forwarded-For"));

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>X-Forwarded-Host="+request.getHeader("X-Forwarded-Hos"));

 &nbsp; &nbsp; &nbsp; &nbsp; out.print("<br>X-Forwarded-Server="+request.getHeader("X-Forwarded-Server&quot;));

%>

All of them return null by visit server2,

So where might the problem be ?

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )