Saturday, October 25, 2014

Re: using cakephp with nginx

i have installed nginx + php-fpm, test it with phpinfo() file and phpmyadmin(downloaded from the phpmyadmin.net website) -> it works correctly and i can access to it by just entering on the browser my_ip/phpmyadmin
when i want to access to one of my cakephp project , i have a redirection to my default login action my_ip/my_cakephp_project/login with an 404 error
the log doesn't contain any error
that's the config that i have used :
  server {      listen   80;         root /home/sites/;      index index.php index.html index.htm;        server_name my_server_ip;        location /doc/ {          alias /usr/share/doc/;          autoindex on;          allow 127.0.0.1;          allow ::1;          deny all;      }        location / {          try_files $uri $uri/ /index.php;      }        error_page 404 /404.html;        location = /50x.html {          root /usr/share/nginx/www;      }        location ~ \.php$ {          try_files $uri =404;          fastcgi_pass unix:/var/run/php5-fpm.sock;          fastcgi_index index.php;          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;          include fastcgi_params;      }        location ~ /\.ht {          deny all;      }  }    server {      listen       80;      server_name     my_server_ip;      root            /home/sites/my_project/app/webroot;        access_log  /var/log/nginx/my_project.access.log;      error_log  /var/log/nginx/my_project.error.log;          location / {          index  index.php;          try_files $uri $uri/ /index.php$is_args$args;      }        location ~ \.php$ {          include        fastcgi_params;          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;          fastcgi_pass   unix:/var/run/php5-fpm.sock;      }        location ~ \.php/ {          include        fastcgi_params;          fastcgi_split_path_info ^(.+\.php)(/.*)$;          fastcgi_param  PATH_INFO $fastcgi_path_info;          fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;          fastcgi_pass   unix:/var/run/php5-fpm.sock;      }        location = /favicon.ico {          log_not_found off;          access_log off;      }        location = /robots.txt {          log_not_found off;          access_log off;      }        error_page   500 502 503 504  /50x.html;      location = /50x.html {          root   /usr/share/nginx/html;      }        location ~ /(\.ht|\.user.ini|\.git|\.hg|\.bzr|\.svn) {          deny  all;      }  }  

thanks

View this message in context: Re: using cakephp with nginx
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: