Per*_*ull 2 php rewrite nginx magento magento-2.0
需要一些帮助PHP-FPM上nginx的1.9.3安装Magento的2.0.2我目前使用的Magento提供的默认配置(https://github.com/magento/magento2/blob/develop/nginx.conf.sample).
发生的问题是在解压缩后访问/设置时,我在"setup/index.php/navigation"以及页面尝试访问的其他URL上显示403.
我已经意识到这个问题的背后是,它不是通过"导航"作为参数传递给index.php文件,并实际上是寻找"的index.php /导航"为文件,并试图传递到PHP5-FPM这导致security.limit_extensions被触发导致403.
那么问题就变成如何获得正确处理的请求?EX当JavaScript作为由设置的index.php请求的index.php /导航渲染我如何确保它传递到index.php作为参数,而不是试图寻找在"的index.php /导航"文件,就好像指数.php是一个目录.
小智 7
我可以看到,这个问题变得越来越普遍.似乎fastcgi_split_path_info需要定义.尝试将nginx.conf.sample/setup location block(我用##指向解决方案代码)更改为:
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";
}}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2022 次 |
| 最近记录: |