Site icon Hip-Hop Website Design and Development

Setup another new subdomain root on top of multisite configuration

I already set up a multisite installation using NGINX configuration below, runs perfectly, but I want to setup another subdomain like dashboard.domain.my on top of this configuration below. I already tried to create a new config file of dashboard.domain.my.conf that points to another document root /var/www/dashboard.domain.my but it redirect me to existing wordpress multisite root /var/www/domain.my/wordpress instead of specified root /var/www/dashboard.domain.my. Any idea on where I should look to make sure this one subdomain I want is separated from the existing wordpress root?

Config file below is for multisite

upstream example-php-handler {
        server unix:/var/run/php/php7.4-fpm.sock;
}

server {

        server_name domain.my *.domain.my;
        root /var/www/domain.my/wordpress;
        index index.php;

        location / {
                try_files $uri $uri/ /index.php?$args;
        }

        location ~ .php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass example-php-handler;
                fastcgi_pass_header Authorization;
        }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/domain.my/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.my/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}


server {
    listen 80;
    server_name domain.my *.domain.my;
    return 301 https://$host$request_uri; # managed by Certbot


}