0

I have a server with ISPConfig + Nginx + PHP, which sets the default webroot to /{userdir}/web. I have access to that folder only, and I cannot change the docroot in nginx.

Most frameworks use a subfolder as their docroot, for example if I install CakePHP, the docroot should be set to /{userdir}/web/webroot

But, because I cannot change the docroot, I need to make some rewrite rules in nginx which will basically change anything going to / to go into /webroot/ I tried the default rewrite rules with CakePHP, and that works fine, because they have an index.php file in the project root directory, so that maps out fine. The problem is for example when trying to access /favicon.png because of the extension, it needs to be served as a file, but there are no rewrite rules for that. Is there some magic rewrite rule, which will route everything to a subfolder as if it were the document root? Here are the default rewrite rules that CakePHP recommends: https://book.cakephp.org/3.0/en/installation.html#nginx

Benjamin Tamasi
  • 662
  • 7
  • 18

0 Answers0