【问题标题】:Configuring MNPP nginx.conf to work with Codeigniter/PHP配置 MNPP nginx.conf 以使用 Codeigniter/PHP
【发布时间】:2012-09-13 13:53:25
【问题描述】:
我有一个标准的 Codeigniter 安装,但似乎无法让 MNPP (MySQL+Nginx+PHP+Python) 识别它。我看到 MNPP 的公共文件夹中有一个 codeigniter 配置,但也无法让 MNPP 使用这些设置。
我已经让我的 Codeigniter 应用程序在 EC2 实例上使用 Nginx 工作,所以我的 Codeigniter 应用程序没有问题。
我还可以在 MNPP 上提供 PHP 页面、MySQL 和 memcache,所以这些也不是问题。有人可以提出一些建议来指引我正确的方向吗?
仅供参考,这是我的 MNPP /Applications/MNPP/conf/nginx/nginx.conf 文件:https://gist.github.com/3711660
为简单起见,我已将其配置为仅包含我的 /Applications/MNPP/conf/nginx/sites-enabled/default 文件:https://gist.github.com/3711653
【问题讨论】:
标签:
php
codeigniter
nginx
【解决方案1】:
哇,这很简单。我回答了我自己的问题。
在我的“/Applications/MNPP/conf/nginx/sites-enabled/default”文件中,我需要做的就是切换 index.html 和 index.php b/c nginx 试图为 index.html 提供服务的顺序首先,b/c 提供了一个 index.html 页面,但它从未看到我的 codeigniter 应用程序 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;
}
是有效的。