The website I'm working on uses 4 Jboss servers. Before accessing the website, the client passes through Apache which will redirect the user to one of the Jboss. As far as I know, the IP address of the client is only known in the Apache layer of this architecture. My question is, what's the possible way to pass that ip address to the Jboss servers? Or can I access them via a SessionManager or HttpServlet or something like that? I need to use them in my code to work on something.
Asked
Active
Viewed 984 times
0
-
2Possible duplicate of [apache ProxyPass: how to preserve original IP address](https://stackoverflow.com/questions/760283/apache-proxypass-how-to-preserve-original-ip-address) – Aaron Oct 20 '17 at 09:23
-
If proposed the duplicate a little too quickly : it will work if you're using mod_proxy, but with 4 backends I guess you may be using mod_cluster? – Aaron Oct 20 '17 at 09:26
-
1Take a look at the headers in the http request. Usually proxies place the original IP there in "X-Forwarded-For" or something like that. – f1sh Oct 20 '17 at 09:28
-
Yes! I used the header "X-Forwarded-For" just like you suggested. Worked like a charm. Thank you! – DaPoox Oct 20 '17 at 09:41
-
@user52713 What are you using in apache to set up the redirections? `proxypass`, `mod_cluster` or something else? The fact that you have Java application servers is mostly irrelevant. – jpaugh Oct 20 '17 at 18:23