I'm trying to setup a cakephp development enviroment with nginx. The nginx + php was successful instaled since I get the right response from phpinfo(); But when I try to setup a virtual host located inside my home dir the nginx returns 404 response.
Take a look at virtual host conf:
server {
listen 80;
server_name www.camisa10_cake.com;
rewrite ^/(.*) http://camisa10_cake.com/$1 permanent;
}
server {
listen 80;
server_name camisa10_cake.com;
location / {
root /home/pedro/dev/pessoais/camisa10_cake;
index index.php index.html index.htm;
# this code is to make pretty url, cakephp needs.
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/pedro/dev/pessoais/camisa10_cake$fastcgi_script_name;
include fastcgi_params;
}
}
Like you can see, my app is located at /home/pedro/dev/pessoais/camisa10_cake/. The response that I get look likes:
"GET / HTTP/1.1" 404 31 "-" "Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0"
I think that would be a permission issue inside my home dir, but I didn't have find it out.
rootoutside the location blocks (i.e. the line belowserver_name- FastCGI needs this to work properly. If the problem persists, increase the verbosity of yourerror_log(possibly to 'info') and turn onfastcgi_intercept_errors. – cyberx86 Dec 26 '11 at 17:07catthe file when logged in as the usernginxruns as? – minaev Dec 27 '11 at 9:50