You have to configure the rewrite rule in the Nginx configuration file for WordPress because Nginx does not use the htaccess file.
Login to Virtualmin >> Webmin >> servers >> nginx >> edit config file
Add the following code to the Nginx configuration file and you're done. Your site should work properly.
location / {
root /home/domains/public_html;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
}
Note: Download the backup of your Nginx config file before making changes. Change Location Path "/home/domains/public_html;" then restart the Nginx service after the changes.