配置MNPP nginx.conf以使用Codeigniter / PHP

时间:2012-09-13 03:39:55

标签: php codeigniter nginx

我有一个标准的Codeigniter安装,但似乎无法让MNPP (MySQL+Nginx+PHP+Python)识别它。我看到MNPP的公共文件夹中有一个codeigniter配置,但无法让MNPP使用这些设置。

我已经让我的Codeigniter应用程序在EC2实例上使用Nginx工作,所以它对我的Codeigniter应用程序来说不是问题。

此外,我可以提供PHP页面,在MNPP上执行MySQL和内存缓存,因此这些也不是问题。可能有人建议指出我正确的方向吗?

仅供参考,这是我的MNPP /Applications/MNPP/conf/nginx/nginx.conf文件:https://gist.github.com/3711660 为了简单起见,我将其配置为仅包含我的/ Applications / MNPP / conf / nginx / sites-enabled / default文件:https://gist.github.com/3711653

1 个答案:

答案 0 :(得分:1)

哇,这很简单。我回答了自己的问题。

在我的“/ Applications / MNPP / conf / nginx / sites-enabled / default”文件中我需要做的就是切换index.html的顺序和index.php b / c nginx试图提供index.html首先,b / c有一个index.html页面,它从未见过我的codeigniter app PHP页面。

所以改变这个:

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

到此:

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

是有效的。