This is a configuration for use with the yii Framework and the nginx web server. Features of this config:
We don't use rewrites at all, just try to find a file under the public directory, if not found, try going through FastCGI instead. We hardcode the SCRIPT_FILENAME and SCRIPT_NAME to go through the main index.php file.
I'm not sure this works for any PHP app since yii does quite a bit of work to normalize stuff (in CWebRequest class).
The public directory just contains symlinks to the assets, images, and css directory. Note that this is only for a local deployment! If we were going remote (FastCGI server on different host) with this, I'm not sure what we should do with the assets directory since it should be writable by PHP and here we are assuming that it is available locally.
The corresponding snippet for the urlManager config:
Random Notes >