Not completely sure which section to ask this question in, thought I'd try the tomcat section first!
I have a reasonably complex web application deployed and running in tomcat. The application is designed to handle multiple customers/sites, so instead of deploying the single application at each customer/site I would like to keep a single install (plus database) under my control. This has advantages in terms of support, upgrades, backups, monitoring, etc ..
If a customer is no longer going to get the actual application, they will need some kind of proxy application. They can't just access the application I host directly as some customers need input from their own environment, e.g. authentication via internal LDAP server. I need to decide on an implementation that allows the following.
* Allow a customer to visit http://internal-ip.com/myapp/listCourses.do
and have the proxy transparently return a web page from http://external-ip.com/myapp/listCourses.do
* Allow the proxy to authenticate the users locally (via internal LDAP server)
* Allow the proxy to cache and serve some content locally, e.g. a large video file would be downloaded once, then served from the proxy.
* Allow the web application structure to change (move pages) without having to update the proxy application, e.g. no hardcoded URL mappings on the proxy. Proxy is as generic as possible and would be able to proxy any web application.
My initial ideas for implementation involve writing a web application, deployed in tomcat/jetty. When a HTTP request comes in, its path is examined to check if a local action is required (e.g. authentication). If not, use a package like Apache HttpClient to make a request to the server run by me. What I don't really like about this implementation is the manual cookie management between the proxy server and the server I run, but I'm not sure how to avoid it.
Alternatively, a java proxy server is hardly a new concept. I don't have much experience with open source java proxies that I could utilise/modify to achieve this. Any pointers to software others have experience with, gratefully received
CUSTOMER -------> PROXY SERVER --------> REMOTE SERVER