Nginx has no directory-level configuration file like Apache’s .htaccess or IIS’s web.config files. All configuration has to be done at the server level by an administrator, and WordPress cannot modify the configuration, like it can with Apache or IIS. Please also see this WP doc for more details – https://wordpress.org/support/article/nginx/.

So as described in the doc, on an Nginx server, after creating an individual domain(subdomain) or creating a site in an subdirectory, you will need to manually add the configuration rules for the domain(website).

Install A Staging Site to A Subdirectory

WPvivid Staging Pro supports installing a staging site to a subdirectory of the live site, in the root directory or the wp-content directory.

Install the staging site to the root directory of the live site

When you choose to install the staging site to the website root, and if the subdirectory name(where the staging site is installed)is monzgvhz(or any name you defined when creating the staging site), you will need to add the following rules to the Nginx config file:

location /monzgvhz(replace this with your own subdirectory name) {

# First attempt to serve request as file, then

# as directory, then fall back to displaying a 404,

#try_files $uri $uri/ = 404;

try_files $uri $uri/ /ybdbfwms/ index.php?$args;

}

WPvivid subdirectory staging root directory

Install the staging site to the wp-content directory of the live site

When you choose to install the staging site to the wp-content directory, and if the subdirectory name(where the staging site is installed)is udlkbpsb(or any name you defined when creating the staging site), you will need to add the following rules to the Nginx config file:

location /wp-content/udlkbpsb(replace this with your own subdirectory name) {

# First attempt to serve request as file, then

# as directory, then fall back to displaying a 404,

#try_files $uri $uri/ = 404;

try_files $uri $uri/ /ybdbfwms/ index.php?$args;

}

WPvivid subdirectory staging wp content

Install A Staging Site to An Individual Domain(Subdomain)

WPvivid Staging Pro also supports installing a staging site to an individual domain(top-level domain and second level domain) that is hosted on the same server as your live site. For example, your live site is a.com, then you can install the staging site to 123.a.com or b.com.

Here is also a step-by-step Nginx offical doc on How to Install WordPress on Nginx and Configure Nginx.

In that case, you will need to create a different conf file for the domain and add the following rules to the conf file to make the staging site to work properly:

root /var/www/html/domain.com/wordpress(replace the root folder of the web server, the domain, and the website directory with your owns);
server_name domain.com(replace this with the individual domain name);

WPvivid subdomain staging

You can even map an individual domain to a different domain’s subdirectory, as long as the domains(websites) are hosted on the same server, for example, 123.b.com to a.com/wordpress/123. In this case, the rules that should be added to the domain’s(123.b.com) conf file are:

root /var/www/html/domain.com/wordpress/subdirectory(replace the root folder of the web server, the domain, and the website subdirectory with your owns);
server_name domain.com(replace this with the individual domain name);

WPvivid subdomain staging individual domain

Notes:

1. After adding the above rules, make sure to restart Nginx server to make the changes effect.

2. For staging sites on Nginx server, make sure to use the same Permalink settings as the live site.