• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Resolved wordpress permalinks don't work with nginx

pacman94

New Pleskian
Hi, this rewrite rule doesn't work.
Code:
location / {
  try_files $uri $uri/ /index.php?$args;
}

this one works:
Code:
if (!-e $request_filename) {
rewrite ^.*$ /index.php?$args last;
}

why and what is the difference? boths are fine?
 
Hi pacman94,

actually, the ( correct / recommended! ) nginx directive:
Code:
    if (!-e $request_filename){
        rewrite ^(.*)$ /index.php break;
        }
OR
Code:
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php?q=$1 last;
        }

... are the basic rewrite directives, which should work in most cases. If you desire to learn more about NGINX directives, I recommend the official NGINX documentation at:



( Pls. keep in mind, that Plesk already uses ( standart ) location directives within the ( standart ) domain specific nginx configuration files, so that additional directives might conflict with already existing location directives. A location directive can only be used ONCE, so that "if" - statements can be used to add additional directives, without conflicting with earlier settings/configurations. ;) ).
 
Hi pacman94,

actually, the ( correct / recommended! ) nginx directive:
Code:
    if (!-e $request_filename){
        rewrite ^(.*)$ /index.php break;
        }
OR
Code:
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php?q=$1 last;
        }

... are the basic rewrite directives, which should work in most cases. If you desire to learn more about NGINX directives, I recommend the official NGINX documentation at:



( Pls. keep in mind, that Plesk already uses ( standart ) location directives within the ( standart ) domain specific nginx configuration files, so that additional directives might conflict with already existing location directives. A location directive can only be used ONCE, so that "if" - statements can be used to add additional directives, without conflicting with earlier settings/configurations. ;) ).

with this one can use nginx only for a site?
 
Hi Kingsley,

with this one can use nginx only for a site?
Your question is not clear enough, to be answered in general, as it depends very much on your ( unique ) content and your settings for your (sub)domain over the Plesk Control Panel.
 
Back
Top