I want to run a drupal installation on a subdirecory of a subdomain. I am using docker containers as I am running various services and through that I can stick to the same syntax and setup structure.
I run a jwilder-nginx-reverse-proxy behind which I have a plain nginx webserver on the subdomain website.domain.com (original domain redacted)
I am already accessing an index.html (website.domain.com) and a phpMyAdmin installation (website.domain.com/pma) and I now want to run several Drupal installations on website.domain.com/v22 website.domain.com/v23 etc. but I cant manage to access the subdomain-subfolders.
Those Drupal installations are drupal-fpm-alpine docker containers that have the copy of a running site from another.domain.com with adapted drupal-site-settings.php.
v23: container_name: v23 image: drupal:8.7.8-fpm-alpine restart: unless-stopped networks: - proxy-tier volumes: - ./html/v23:/var/www/html v22: ... v21: ... My nginx.conf looks like this:
server { listen 80; listen [::]:80; server_name website.domain.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri =404; } location ~ \/pma/ { rewrite ^/pma(/.*)$ $1 break; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://pma; } location /v23/ { location ~ / { try_files $uri /index.php$is_args$args; } rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass v23:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } location ~ /\.ht { deny all; } location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { expires max; log_not_found off; } } #location /v22/ { #... # fastcgi_pass v22:9000; #... #} #location /v21/ { #... # fastcgi_pass v21:9000; #... #} } This config is an edited copy of a config of my working nginx.conf from another.domain.com where I run drupal without subfdolder - but it doesn't work. In the end I am now stuck with a downloaded index.php and 404 Not Found error on website.domain.com/v23
#2024/09/18 15:32:47 [error] 7#7: *1 directory index of "/etc/nginx/html/v23/" is forbidden, client: 172.25.0.4, server: website.domain.com, request: "GET /v23/ HTTP/1.1", host: "website.domain.com" If I try to access the index.php itself via website.domain.com/v23/index.php it just downloads that file instead of running it via php-fpm.
Can someone direct me towards an working solution for that?