LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tomcat HttpServlet cannot see correct remote address (https://www.linuxquestions.org/questions/linux-newbie-8/tomcat-httpservlet-cannot-see-correct-remote-address-611632/)

umach 01-06-2008 11:39 PM

Tomcat HttpServlet cannot see correct remote address
 
I have a pound reverse proxy on port 80. It redirects all calls to 8080 where my Tomcat is running. My program needs to access the remote client address using method getRemoteAddr() . However I get the address as 127.0.0.1. I am guessing this is because of the pound reverse proxy intercept and forward mechanism. How can I fix this problem. I was thinking that perhaps I can get pound to extract the remote address of the incoming call and add it as a header(with a name like "RemoteCallerIP") when forwarding the call. I can then call the getHeader("RemoteCallerIP") in the Tomcat servlet and extract the remotre caller IP. If this is the right approach can someone help with the snntax for pound.cfg file to solve this. If there is another approach that is correct I would like to know that.

Thanks,
Umach


All times are GMT -5. The time now is 05:07 PM.