So I'm building microservice architecture and I have separate cakePHP installations for Administration and Partners. So https://example.com is going to be served for normal users and that works fine as it's a standard installation.
But I can't figure out how to set up other two that they work as https://example.com/admin and https://example.com/partners. I use nginx to direct traffic to the correct docker container running admin and partners cakephp. Problem is how to let CakePHP know that his root website path is /admin
and not just \
? Because all the routing gets messed up.
I'm using CakePHP 4.x and PHP 7.2.x
I think it's not a good option to create multiple projects for different AUTH (Partner/Administration). Cakephp allow multiple authentication for different roles. Example: for a school project I had created Admin/School/Teacher/Students using different AUTH and AUTH storage , which never conflict with each other.
In your case there is a solution . Assuming that you want to use https://example.com/ and Partner and https://example.com/admin as administrator.
1.First host your Partner project in ROOT.
Create a folder , named "admin" in Partner root projects folder.
Copy/Move your admin project code to your "admin" folder.
Change/update your ".htaccess" files in Partner root folder(FOR APACHE).
APACHE CODE
After "RewriteEngine on " a new line added to bypass the PARTNER cakephp.
NGINX