zigojacko
Basic Pleskian
Ever since I can remember, when running domains with Nginx on a server with Plesk, I have to add the following to the Additional nginx directives section:
This is with proxy mode off so it doesn't proxy requests to Apache.
Without these directives, any page other than the homepage on the website throws an Nginx 404 error.
But... I actually have no idea what exactly these directives are doing.
Please could someone advise:-
1) What do these directives to exactly?
2) Are they actually needed (or recommended)?
3) Is there or should there be another way of getting pages to display on sites without these directives?
This only seems to be an issue on servers running Plesk. Don't have the problem otherwise.
Code:
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?$1;
}
This is with proxy mode off so it doesn't proxy requests to Apache.
Without these directives, any page other than the homepage on the website throws an Nginx 404 error.
But... I actually have no idea what exactly these directives are doing.
Please could someone advise:-
1) What do these directives to exactly?
2) Are they actually needed (or recommended)?
3) Is there or should there be another way of getting pages to display on sites without these directives?
This only seems to be an issue on servers running Plesk. Don't have the problem otherwise.