Recommendations for multiple database bakes / parallel apps?

I’m using cakePHP to create a data input website for a series of databases. I want them all to be available on the same site, but in their own subfolders, e.g. https://mysite/movies, https://mysite/books

The database tables sometimes have the same names, so I don’t think I can just set up multiple datasources and cake bake all. Or is there a way to add a prefix to table names to distinguish between databases?

I have tried setting up separate instances of cakePHP for each database, with an index.php file in the parent folder containing links to each:

Mysite folder
   | 
   | ---- index.php
   |
   | ----- movies folder (cakephp instance)
   |              | ----- index.php
   |
   | ----- books folder (cakephp instance)
                 | ----- index.php

In that case, requests to e.g. https://mysite/movies are successful because they are directed to https://mysite/movies/index.php, but requests to https://mysite/movies/actors are not successful because they are directed to https://mysite/index.php

Looks like I need to set up some url rewriting rules in the web server, or forward the requests using PHP in Mysite/index.php. Or is there a cakePHP-specific method?

I am guessing this setup is fairly common, so I wondered if anyone has an example of an effective approach.

I have solved it by switching from Nginx to Apache in my DDEV environment.

I’m taking the same multiple cakephp instances approach, it seems that there are default mod_rewrite rules for Apache in the .htaccess files which take care of the routing.