We have an application built on microservices i.e. each component within the application is hosted on the same machine but different tomcat instances i.e. different ports (8080, 8081, 8082).
Scenario: We have a virtual server (https://abc.com) pointing to for example 18.104.22.168:8080.
Based on the context root, I would like the traffic to be routed to different ports where they are hosted.
E.g. /example1 is hosted on port 8080, /example2 is on 8081, /example3 is on 8082.
If the url is https://abc.com/example1/*, the traffic should be routed to 22.214.171.124:8080. If the user clicks another tab on the application UI then the context root changes from /example1 to /example2 etc and F5 should redirect it to a different tomcat instance on the same machine i.e. If context root changes to /example2/* then traffic to be routed to 126.96.36.199:8081, for /example3/* routed to 188.8.131.52:8082.