在Nginx安装页面上安装Magento 2.0.2不起作用


Installing Magento 2.0.2 on Nginx setup page not functioning

需要一些帮助,使用 php-fpm 在 nginx 1.9.3 上安装 Magento 2.0.2 目前我使用的是 Magento (https://github.com/magento/magento2/blob/develop/nginx.conf.sample 提供的默认配置(。

正在发生的问题是,在解压缩后访问/setup时,我看到"setup/index.php/navigation"以及页面尝试访问的其他URL的403

我已经意识到这背后的问题是它没有将"导航"作为参数传递给索引.php文件,实际上是在查找"index.php/navigation"作为文件并尝试将其传递给 php5-fpm,这会导致触发security.limit_extensions导致 403。

所以问题变成了我如何获得正确处理的请求?例如,当由设置索引呈现的javascript时.php请求index.php/navigation,我如何确保它作为参数传递给index.php而不是尝试在"index.php/navigation"中查找文件,就好像index.php是一个目录一样。

正如我所看到的,这个问题变得越来越普遍。看来fastcgi_split_path_info需要定义。尝试将nginx.conf.sample/setup位置块(我指向带有##的解决方案代码(更改为:

location /setup {
root $MAGE_ROOT;
location ~ ^/setup/index.php {
    ### This fixes the problem:
    fastcgi_split_path_info ^(.+?'.php)(/.*)$;
    ################################
    fastcgi_pass   fastcgi_backend;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}
location ~ ^/setup/(?!pub/). {
    deny all;
}
location ~ ^/setup/pub/ {
    add_header X-Frame-Options "SAMEORIGIN";
}}