You need to add the following to the nginx .conf for your site:
location / {
try_files $uri $uri/ /index.php?$args;
}
You can make virtualmin create new virtual hosts with this config built in, although updates to virtualmin will wipe this out:
Login as root, or sudo and edit the following file in your favorite editor:
/usr/share/webmin/virtualmin-nginx/virtual_feature.pl
Jump down to line 247, and you’ll see the following:
my $ploc = { 'name' => 'location’,
'words' => [ '~', '\.php$' ],
'type' => 1,
'members' => [
{ 'name' => 'try_files',
'words' => [ '$uri', '=404' ],
},
{ 'name' => 'fastcgi_pass',
'words' => [ $port =~ /^\d+$/ ?
'localhost:'.$port :
'unix:'.$port ],
},
],
};
&save_directive($server, [ ], [ $ploc ]);
Right below that (before the “&flush_config_file_lines();” line), paste in the following:
my $wordpress = { 'name' => 'location',
'words' => [ '/' ],
'type' => 1,
'members' => [
{ 'name' => 'try_files',
'words' => [ '$uri', '$uri/', '/index.php?$args' ],
},
],
};
&save_directive($server, [ ], [ $wordpress ]);
Save and exit.