我已成功设置 Magento 2.0 并尝试同时安装 Drupal。我的 Nginx 配置:
upstream fastcgi_backend {
server unix:/var/run/php/php7.0-fpm.sock;
}
server {
listen 80;
server_name www.my-server.com;
set $MAGE_ROOT /var/www/magento;
set $MAGE_MODE default;
include /var/www/magento/nginx.conf.sample;
location /drupal/ {
root /var/www/html;
fastcgi_pass fastcgi_backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我还index.php
向/var/www/html
.
执行curl http://www.my-server.com/drupal/
给File not found.
如何在 Magento 旁边添加 Drupal 安装?
更多细节
Nginx 错误日志
*3 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: www.my-server.com, request: "GET /drupal/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "www.my-server.com"
Magento Nginx 配置
HTTP 标头
curl -I http://www.my-server.com/drupal/
HTTP/1.1 404 Not Found
Server: nginx/1.8.1
Date: Wed, 20 Apr 2016 06:12:08 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive