【问题标题】:dotCloud nginx.conf: how to get the "index index.php" directive to work?dotCloud nginx.conf:如何让“index index.php”指令工作?
【发布时间】:2013-01-21 03:10:08
【问题描述】:

我通过“推送”应用程序目录中的 nginx.conf 文件来进行身份验证,所以我知道该文件有效,但 /app 不会触发 /app/php.index。我无法让 nginx 在我的 vista 笔记本电脑上使用 php 运行,也无法编辑 dotCloud 实例中的 /etc/nginx/nginx.conf,因为 dotCloud 不给 root 权限会让生活变得困难。

(注意 .htpasswd 是相对于 ngnix.conf 文件位置的,很好)。

server { 

location / {
          index  index.php;
}


location /admin {
            auth_basic "enter password";
            auth_basic_user_file .htpasswd;
    index  index.php;
   }


}

【问题讨论】:

    标签: dotcloud


    【解决方案1】:

    您可能需要一个 nginx 指令来将请求映射到您的动态内容。然后,此控制器可以适当地路由它们。

    try_files $uri $uri/ /index.php;
    

    有关示例项目,请参阅CakePHP tutorial

    【讨论】:

      猜你喜欢
      • 2011-06-22
      • 2013-10-21
      • 2019-12-29
      • 1970-01-01
      • 2014-03-08
      • 1970-01-01
      • 1970-01-01
      • 2014-03-13
      • 2023-03-23
      相关资源
      最近更新 更多