We have a single application which is used by multiple customers. It's every time the same app, but with a different database.
Our current setup consists of:
- Apache 2 Web Server
- Tomcat 8
- Spring 4.1
The Web Server routes specific URLs to Tomcat, i.e.
- /customer1 -> tomcat/customer1
- /customer2 -> tomcat/customer2
Now we'd like to keep those entries within Apache Config, but somehow configure Tomcat and Spring. Basically Tomcat should take every request (maybe defined by regex - not necessary) and route it to one application.
Currently one application runs at /webapps/customer1
and another instance at /webapps/customer2
.
In the future the application should somehow run at /webapps/*
, so within spring I can have a look at the request URL and choose db_customer1
for requests at /customer1/...
and the same for customer2
.
Is this possible to achieve?