在 Nginx 设置页面上安装 Magento 2.0.2 无法正常工作
Installing Magento 2.0.2 on Nginx setup page not functioning
需要一些帮助在 nginx 1.9.3 上使用 php-fpm 安装 Magento 2.0.2 目前我正在使用 Magento ( https://github.com/magento/magento2/blob/develop/nginx.conf.sample ) 提供的默认配置。
发生的问题是在解压后访问 /setup 时,我在 "setup/index.php/navigation" 以及页面尝试访问的其他 URL 上看到了 403。
我意识到这背后的问题是它没有将 "navigation" 作为参数传递给 index.php 文件,实际上是在寻找 "index.php/navigation" 作为文件并试图将其传递给 php5-fpm,这会导致 security.limit_extensions 被触发,从而导致 403.
所以问题就变成了如何正确处理请求?
E.X。当设置 index.php 呈现的 javascript 请求索引时。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";
}}
需要一些帮助在 nginx 1.9.3 上使用 php-fpm 安装 Magento 2.0.2 目前我正在使用 Magento ( https://github.com/magento/magento2/blob/develop/nginx.conf.sample ) 提供的默认配置。
发生的问题是在解压后访问 /setup 时,我在 "setup/index.php/navigation" 以及页面尝试访问的其他 URL 上看到了 403。
我意识到这背后的问题是它没有将 "navigation" 作为参数传递给 index.php 文件,实际上是在寻找 "index.php/navigation" 作为文件并试图将其传递给 php5-fpm,这会导致 security.limit_extensions 被触发,从而导致 403.
所以问题就变成了如何正确处理请求? E.X。当设置 index.php 呈现的 javascript 请求索引时。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";
}}