As part of upgrading a legacy Java application (hosted on Weblogic cluster), one section of this application will be replaced by a single page application (REACT), calling out over an API to various services that contain migrated backend functionality. For now until all UI dependencies are ported off the legacy application, the REACT SPA will still be hosted inside a JSP page (some common JSP code has not been ported, and so will be present on the JSP page hosting the react app).
The infrastructure hosting this setup is currently an Apache server, routing to the Weblogic cluster or newer services as needed. Proxying to the weblogic cluster was simple before, as all *.jsp pages were routed to the cluster with a simple weblogic plugin block:
Turns out there was an apache feature (Passthrough) I was not aware of (or at least how exactly it works) that can bridge Apache rewrite rules to the weblogic plugin nicely.
RewriteRule /newSection/.*$ /SPA.jsp [PT,L]
The passthrough rewrites the URI to http://host/SPA.jsp WITHOUT doing a rewrite. The passthrough then explicitly passes that new URI back through the rule stack and other modules. At this point the original weblogic plugin rule I had that proxies by MIME type to the cluster (*.jsp) will pick up the URI and work nicely.
This way Apache takes care of rewriting a set of paths to a specific URI, and the weblogic plugin nicely takes care of the rest (proxying to cluster, load balancing, sticky sessions, etc.)