HTTP gateway for multiple pages
We are working on a gateway server that would serve as an entry point for multiple web pages. The gateway is accessible at http://example.com and every web page that is routed to has a unique URL, for instance http://example.com/app1 will take you to app1. Application app1 is located at some internal server, say http://app1.internal, and is available to outside only through the gateway.
The gateway doesn't send a 302 redirect to user, but instead fetches the content from app1 and serves it to the user at http://example.com/app1. We cannot edit the source code of app1, so there must be some mechanism to rewrite URLs, i.e. /images/image1.jpg becomes /开发者_JAVA百科app1/images/image1.jpg.
This works well with images and static content, but doesn't work with javascript, css and URLs that are embedded in some element attributes, etc. Currently we create special code for every such case.
So, I am looking for some better way to solve this problem. Maybe there is some software which has such functionality? Or some way to tag every request coming from a page? All ideas are welcomed.
Thanks in advance!
It kind of sounds like what you're looking for is a reverse proxy, of which there are many options.
精彩评论