jyr / MNPP

Mac + Nginx + Percona + PHP a high performance web server in a one-click installer
http://getmnpp.org
314 stars 49 forks source link

Can't configure nginx.conf to work with Codeigniter #49

Closed tim-peterson closed 12 years ago

tim-peterson commented 12 years ago

I have a standard Codeigniter installation but can't seem to get MNPP to recognize it. I saw there is the codeigniter config in the common folder but can't get MNPP to recognize that either.

I've gotten my Codeigniter app to work using Nginx on an EC2 instance so its not a problem with my Codeigniter app.

Also I can serve PHP and do MySQL and memcache on MNPP but just not my Codeigniter app. Might one suggest something to point me in the right direction?

here's my MNPP /Applications/MNPP/conf/nginx/nginx.conf file: https://gist.github.com/3711660 which for the sake of simplicity I have configured to ONLY include my /Applications/MNPP/conf/nginx/sites-enabled/default file : https://gist.github.com/3711653

tim-peterson commented 12 years ago

Wow, that was simple. I answered my own question.

In my "/Applications/MNPP/conf/nginx/sites-enabled/default" file all I need to do was switch the order of index.html and index.php b/c nginx was trying to serve index.html first and b/c there was an index.html page that was served and it never saw my codeigniter app php pages.

So changing this:

location / {
        root   /Applications/MNPP/Library/nginx/html;
        index  index.html index.php  index.htm;
    }

to this:

        location / {
        root   /Applications/MNPP/Library/nginx/html;
        index  index.php index.html index.htm;
    }

is what worked.

jyr commented 12 years ago

Sorry for my delay, if you need more examples, look https://github.com/jyr/MNPP/tree/master/htdocs