lundi 29 juin 2015

Include config for subdirectory in Nginx


For example, I have a webserver for testing.

Now I put Drupal 8 in a Subdirectory.

The server config in Nginx is OK for plain php files, but Drupal needs another config because of URL scheme.

My goal is something like this:

normal.cfg

server {
   listen 80;
   server_name _;

   location (phpfiles) {
      pass to PHPFPM;
   }
}

drupal_test.cfg

server {
   listen 80;
   server_name _;

   location /drupal/(phpfiles) {
      do_some_magic
      pass to PHPFPM;
   }
}

But then Nginx complains about ignoring duplicated server_name.

So, how can I include a specific (separated file) configuration for a given subdirectory of a given server_name that I can later delete without much problems? This is because I don't want to mess up the main config.


Aucun commentaire:

Enregistrer un commentaire