1

我已成功设置 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 配置

nginx.conf.sample

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
4

1 回答 1

0

由于我是 Nginx 和 Drupal 的新手,我无法在不同的位置同时获得这两种服务。

我的解决方法是使用 2 个不同的域,因为 Nginx 支持多个服务器:

server {
    server_name www.my-server.io;
    ...
}

server {
    server_name www.my-drupal-server.io;
    ...
}
于 2016-04-24T06:59:39.250 回答