nginx
nginx copied to clipboard
Drupal multisite as subfolder
I'm struggling to create multisites as subfolders in a Drupal 10.
For example my Drupal website has this url: http://d10.docker.localhost
And my multisites should be of this form:
- http://d10.docker.localhost/site1
- http://d10.docker.localhost/site2
So inside my sites.php I have:
<?php
$sites["d10.docker.localhost.site1"] = "site1";
$sites["d10.docker.localhost.site2"] = "site2";
And each multisites have their own folder under /var/www/html/web/sites with settings.php with their own database (for now empty)
- /var/www/html/web/sites/site1
- /var/www/html/web/sites/site2
According Drupal 7 documentation (Doc for Drupal 8/9/10/11 was not updated), we also need to create symlinks for each multisite in web/ folder pointing to web.
So from /var/www/htm/web I did
ln -s . site1
ln -s . site2
chown -h 1000:82 site1 # to get correct owner/group
chown -h 1000:82 site2
If I test drush status
inside multisite folder, I can see correct multisite detected.
So for Drupal, multisite seems correctly declared.
But when I browse urls:
- http://d10.docker.localhost/site1 returns a 404 from Drupal.
- http://d10.docker.localhost/site1/core/install.php returns a 404 from nginx.
- http://d10.docker.localhost/site1/core/misc/druplicon.png I got a 200 response
So according 3., it seems nginx follows correctly the symlinks, but according 2. and 3. it seems there is something wrong with priority and symlinks.