I have two applications deployed in jboss container(same unix box). If i get a request from app1, i need to frame a corresponding request for app2.
eg:
If you use the load balancer & Nginx, config them without modify code.
Nginx:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
Tomcat's server.xml Engine:
If only modify Nginx config file, the java code should be:
String XForwardedProto = request.getHeader("X-Forwarded-Proto");