-1

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? :)

1 Answer 1

0

Throlkim, what exactly is being displayed when you browse to the url you want to use? ie are you getting a 504 error message etc

you need to have something similar to this which works for me

server { listen 80; server_name yourwebsite.com; access_log /path_to_your_logfile/log/access.log; error_log /path_to_your_logfile/log/error.log; location / { root /path_to_cake_root/cake/app/webroot; index index.php; if (-f $request_filename) { break; } if (!-f $request_filename) { rewrite ^/(.+)$ /index.php?url=$1 last; break; } #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /path_to_cake_root/cake/app/webroot/index.php; #$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } } 

I asked a similar question which was resolved as per accepted answer and a bit of tweeking cakephp & nginx config/rewrite rules

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.