Drupal 7多站点子文件夹nginxconfiguration

我正在使用perruioconfiguration的Drupal,但我认为这是专为单一的网站。 PHP不能在子文件夹中工作。

我想创build一个结构如下:

主要网站

  • /var/www/domain.com/master/src/

子站点

  • 在/ usr /本地/子网站/ _site1 / src目录/
  • 在/ usr /本地/子网站/ _site2 / src目录/
  • 在/ usr /本地/子网站/ _site3 / src目录/

我想要访问的子网站如下:

domain.com/site1 domain.com/site2 domain.com/site3 

有没有任何nginxconfiguration?

我想添加3个子文件夹到以下configuration。

 # -*- mode: nginx; mode: flyspell-prog; ispell-current-dictionary: american -*- ### Configuration for domain.com. ## HTTP server. server { listen 80; # IPv4 server_name localhost; limit_conn arbeit 32; ## Access and error logs. access_log /var/log/nginx/domain.access.log; error_log /var/log/nginx/domain.error.log; ## See the blacklist.conf file at the parent dir: /etc/nginx. ## Deny access based on the User-Agent header. if ($bad_bot) { return 444; } ## Deny access based on the Referer header. if ($bad_referer) { return 444; } ## Protection against illegal HTTP methods. Out of the box only HEAD, ## GET and POST are allowed. if ($not_allowed_method) { return 405; } ## Filesystem root of the site and index. root /var/www/domain.com/master/src/; index index.php; fastcgi_keep_conn on; # keep alive to the FCGI upstream ################################################################ ### Generic configuration: for most Drupal 7 sites. ################################################################ include apps/drupal/drupal.conf; include apps/drupal/drupal_install.conf; include apps/drupal/drupal_upload_progress.conf; include nginx_status_vhost.conf; } # HTTP server 

你正在使用的configuration是相当彻底的硬编码,期望网站的根是唯一的drupal实例 – 吨的绝对location块: https : //github.com/perusio/drupal-with-nginx/blob/D7/应用/ drupal的/ drupal.conf

我不build议编辑所有这些,这让我感到畏缩,所以我build议你在nginxconfiguration中使用一个虚假的主机名(比如site1.example.com创build每个子站点自己的server块,然后设置在主服务器模块中反向代理 ,以代理example.com/site1site1.example.com