Open heyyo-droid opened 3 weeks ago
If we replace nginx container with wodby apache, it works as expected.
@csandanov it looks like related to fastcgi_param SCRIPT_FILENAME $document_root/index.php;
$document_root
is always /var/www/html/web
but for multisite we need /var/www/html/web/site1
for example.
it looks like the variable $realpath_root
fixed this according this article:
https://joshtronic.com/2019/07/29/symlinks-with-nginx-and-php-fpm/
https://nginx.org/en/docs/http/ngx_http_core_module.html#var_realpath_root
So in the meantime, it's fixed in wodby nginx itself, I tried to use custom preset to see if my theory is exact.
So I created a preset called multisite
from a copy of drupal 10 preset file.
And also a corresponding upstream config file.
By using this custom preset website is still working :-)
NGINX_SERVER_ROOT: /var/www/html/web
# NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
NGINX_VHOST_PRESET: "multisite"
volumes:
- ./:/var/www/html:cached
- ./nginx/multisite.conf.tmpl:/etc/gotpl/presets/multisite.conf.tmpl
- ./nginx/upstream.multisite.conf.tmpl:/etc/gotpl/includes/upstream.multisite.conf.tmpl
Now it looks like replacing $document_root
by $realpath_root
is far from being enough...
For example those locations won't work for subfolders, so need to be also modified to allow any subfolder prefix, that could potentially open more security issues:
location = /index.php {
...
location = /core/install.php {
...
location = /core/rebuild.php {
...
location ~* ^/core/authorize.php {
...
location = /cron {
...
location ~* ^/update.php {
...
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:
So inside my sites.php I have:
And each multisites have their own folder under /var/www/html/web/sites with settings.php with their own database (for now empty)
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
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:
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.