When placing a CakePHP 3 project to a subdirectory, it will not work out of the box. Some specific Nginx setups are required for it to work.
For demonstration purposes, suppose we want to place a CakePHP 3 project to a subdirectory called demo.
Table Of Content
Serving static files
Static files are served directly from the webroot folder, so the Nginx configuration blocks looks like something below:
Serving PHP content
Other requests will be directed to index.php file which leads to the CakePHP's router:
In this tutorial, we demonstrate how to set up a CakePHP 3 in a subdirectory using Nginx. Hope you find this technique useful.