• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Nginx config for WordPress rewrite rules

Gabor H

Basic Pleskian
Hi,

How to configure Nginx, to make it work properly with WordPress rewrite rules correctly?

I've this in a domain's additional nginx directives:

if (!-e $request_filename) { rewrite ^.*$ /index.php last; }


But sometimes nginx struggling with the rewrite rules, I guess, because some pages are broken.
Pls help me to find the best nginx config for rewrite.

G.
 
Hi Gabor H,

Wordpress itself offers a guide with some standard configurations: => https://codex.wordpress.org/Nginx
Pls. note, that almost all issues with "broken" links are based on the fact, that when you use apache2 AND nginx, unique ".htaccess" - definitions are not correctly converted into nginx directives. Often enough, additional plugins require rewrites which are automatically added into the ".htaccess" - files, but the webmaster forgot that he/she uses niginx as well and the needed nginx directive is missing. :(

Plesk offers as well a wonderfull tool called "htaccess to nginx" - converter. You find this extension at the "Extension catalog" ( "Home > Extensions Management > Extensions Catalog" ), or at => htaccess to nginx at ext.plesk.com
 
Hi UFHH01,

Thanks for your reply.
I've finally sorted out the issues.

But, some broken pages are still exist.
Which is unfortunately an off-topic related issue.
A WP theme cookie(s) has long, or longer than needed validation time.
(some pages only loading in right order, when browser's cache+cookie deleted)

Is there any solution maybe, or do you know a solution maybe to control cookies invalidation via
Nginx?


Regards,
Gabor


Hi Gabor H,

Wordpress itself offers a guide with some standard configurations: => https://codex.wordpress.org/Nginx
Pls. note, that almost all issues with "broken" links are based on the fact, that when you use apache2 AND nginx, unique ".htaccess" - definitions are not correctly converted into nginx directives. Often enough, additional plugins require rewrites which are automatically added into the ".htaccess" - files, but the webmaster forgot that he/she uses niginx as well and the needed nginx directive is missing. :(

Plesk offers as well a wonderfull tool called "htaccess to nginx" - converter. You find this extension at the "Extension catalog" ( "Home > Extensions Management > Extensions Catalog" ), or at => htaccess to nginx at ext.plesk.com
 
This one below works best for me with nginx. Put it in Apache & nginx Settings -- Additional nginx directives

if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
 
Back
Top