WordPress website shows 404 Not Found Plesk Onyx
For existing website:
Add the content below to the Additional nginx directives field in Plesk at Domains > example.com > Apache & nginx Settings:
if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {
set $test “${test}C”;
}
if ($test = PC) {
rewrite ^.*$ /index.php break;
}
For new websites only:
Add the content below to the nginx directives field in the service plan configuration in Plesk at Service Plans > Example Plan > Web Server tab:
if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {
set $test “${test}C”;
}
if ($test = PC) {
rewrite ^.*$ /index.php break;
}
Note: Additional nginx directives will be applied to new websites only created under this server plan. All existing websites under this service plan will not take changes.