简体   繁体   中英

Configuring MNPP nginx.conf to work with Codeigniter/PHP

I have a standard Codeigniter installation but can't seem to get MNPP (MySQL+Nginx+PHP+Python) to recognize it. I saw there is a codeigniter config in MNPP's common folder but can't get MNPP make use of those settings 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 pages, do MySQL and memcache on MNPP so those aren't the issue either. Might one suggest something to point me in the right direction?

FYI, 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM