运行 Nginx 和 Drupal

Running Nginx and Drupal

我是 Nginx 的新手,但我设法在 windows 8 机器上安装了 Drupal。我只是注意到这个 URL(http://localhost:8080/drupal/) spits out error message 403 Forbidden. If I mutate that URL a bit by including the index(http://localhost:8080/drupal/index.php) 文件然后按预期工作。我的问题是: 我如何配置 Nginx 以便在我转到 http://localhost:8080/drupal/?

时不会收到错误消息

根据您的配置,index 指令将鼓励 nginx 在遇到目录时查找特定文件:

index index.php;

对于更具体的规则,要挑出一条路径并将其映射到控制器,您可以使用完全匹配 location 指令:

location = /drupal/ { rewrite ^ /drupal/index.php last; }

有关更多信息,请参阅 this and this