How to stop Nginx sending static file requests to the CakePHP app controller when running Cake in a

Posted by Throlkim on Server Fault See other posts from Server Fault or by Throlkim
Published on 2009-10-12T11:28:01Z Indexed on 2010/04/04 10:03 UTC
Read the original article Hit count: 288

Filed under:
|
|
|

I'm trying to run a CakePHP app from within a subfolder on Nginx, but the static files are not being found and are instead being passed to the app controller. Here's my current config:

    location /uniquetv {
        index index.php index.html;

        if (-f $request_filename) {
            break;
        }

        if (!-e $request_filename) {
            rewrite ^/uniquetv(.+)$ /uniquetv/webroot/$1 last;
            break;
        }
    }                                        

    location /uniquetv/webroot {
        index index.php;

        if (!-e $request_filename) {
            rewrite ^/uniquetv/webroot/(.+)$ /uniquetv/webroot/index.php?url=$1 last;
            break;
        }
    }

Any ideas? :)

© Server Fault or respective owner

Related posts about cakephp

Related posts about php