简体   繁体   中英

How to get the actual URL in case of load balancer proxy server

I am using Tomcat Server (two instances) to run my web applications. And apache web server as proxy server. I have used the proxy server as a load balancer to transfer the requests to the two instances of tomcat server.

In my logic, i have to differentiate between the requests coming from server URL directly or from proxy url. Is there a way to get the proxy URL in the java code of my web applications. Can I pass some extra parameters from load balancer itself to identify that the request is coming from proxy URL.

Please let me know if more information is required. Thanks in advance for your help.

I'm assuming you are using mod proxy (mod_jk/mod_ajp preserves the proxy host)

Retrieve the "X-Forwarded-Host" header from request, which is the original host requested by the client.

See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM