Sunday, October 26, 2014

Re: using cakephp with nginx

So basically you are able to see your project when visiting your server ip but getting a 404 when redirected to the login? My guess is that your login address looks like 192.168.1.123/my_broken_project/login? You actually can use an ip address as a server_name but only one site will be available using that address (afaik) and it defeats the purpose of wanting to run multiple sites from a single IP. As Salines responded, you can use wildcards and regular expressions but I have zero experience in that area ... the need to never arose and using simple server names has always been more than sufficient for me. 

As far as the root value in your config, that depends on how you have Cake set up. Basically, if you navigate to your webroot directory and have to go through an app directory to get there, then your root would be /var/www/my_broken_project/app/webroot

As far as editing your /etc/hosts file ... yes, it affects only your local machine. If you want to only run a single project from a single ip address, it would be optional. If you are running multiple projects, it's mandatory (at least with the setup I've explained). There are other ways of reaching your dev server such as using a service like dyn.com. The setup that I've explained may not be the only way, but in my opinion is the simplest, most straight-forward way to get yourself started with little or no experience with nginx and a local dev server. 

On Sun, Oct 26, 2014 at 6:26 AM, flashios09 <flashios09@gmail.com> wrote:
thanks for all the explanation.
i forget to say that with apache the same project worked correctly -> i don't have the 404 error after being redirected to the default login action .
i have two more small question:
1- for the root value in the config i write this
root        /var/www/my_broken_project/webroot;  
or this
root        /var/www/my_broken_project/app/webroot;  
2- for your 4th point in the previous reply
On your local machine (not your server) open /etc/hosts and add...
is this a necessary step or optional because if i change the local hosts file it affect only my local machine ?
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 a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/saCWNRwkWhs/unsubscribe.
To unsubscribe from this group and all its topics, 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.

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