I have multiple instances of versioned application rooted at the same context but hosted on different machines. I have to access these applications externally via reverse proxy like Apache in the following way, if possible:
 
http://reverse_proxy_host/instance1/app maps to http://internal.host1.com/app
http://reverse_proxy_host/instance2/app maps to http://internal.host3.com/app
http://reverse_proxy_host/instanceN/app maps to http://internal.hostN.com/app
 
All links within our application are relative: /app/<resource>
 
Seems like an easy requirement but I have not been able to find solution for it using mod_proxy, mod_proxy + mod_rewrite. There seems to be solution that we have with mod_proxy + mod_proxy_html which modifies relative links to /instance1/app/<resource>. Is it the only way to accomplish this task?
 
Last soft requirement that I can live without is dynamic mappings. That is, preferably database driven but could be text file driven mapping configuration.
 
Also, I wanted to clarify that I'm not looking for a load balancing solution.
 
Any help appreciated including alternatives to Apache reverse proxy implementation.
 
Regards,
Andre Piwoni
 

------------------------------------------------------------------------------

This email is confidential and may be legally privileged.

It is intended solely for the addressee. Access to this email by anyone else, unless expressly approved by the sender or an authorized addressee, is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution or any action omitted or taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please contact the sender, delete this e-mail and destroy all copies.

==============================================================================