aspose file tools*
The moose likes Servlets and the fly likes webapp as proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "webapp as proxy" Watch "webapp as proxy" New topic
Author

webapp as proxy

Robert Garrido
Ranch Hand

Joined: Dec 11, 2008
Posts: 30
Hi,

I have 6 different web-apps (let's call their contexts /wa1, /wa2 ... /wa6) running in port 8080.

I have another web-app named /proxy running on port 80. As the name suggests this web-app does proxy functions for the other 6 web-apps. This proxy basically is meant to go to any of the web-apps and follow any number of redirects until a final page is reached, so external clients always get the needed resource in one shot.

For instance, a client requests: http://hostname:80/wa1/resourcex, then the request should actually go to http://hostname:80/proxy, after that the proxy makes all calls following redirects to http://hostname:8080/wa1/resourcex (where the actual web-app context runs) and returns the final result to the client.

I can't modify any of the 6 original webapps, however I can do whatever I want with the proxy one. How can I get this done?

Please assist. Thanks in advanced!
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

I don't know if this can be done or not (or if it is the right way or not), but I think you'll have to run your proxy as ROOT in your Tomcat (if you are using tomcat) i.e. your proxy should run on the default/root context. I assume that your server on port 8080 and 80 are different. I also know of ngnix if that would be useful (it was used on one of my earlier sites that I worked on but I don't know much about it)...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: webapp as proxy
 
Similar Threads
req.getServerName() and req.getServerPort()
Connector set-up
Writing proxy server with Java? ("Intercepting" sockets)
How to enable SSL for only one site in Tomcat
Configure Apache to forward request to Tomcat