• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question nginx + wordpress: SEO Urls error

eiskaltereistee

New Pleskian
Hi,

I created a simple sub domain in wordpress (A development copy of a wordpress page). The WP-Installation uses php 7.1 with nginx as proxy.
Also I have added a .htaccess password protection via plesk gui.

In the additional nginx configuraton I added the following lines:
Code:
if (!-e $request_filename){
    rewrite ^(.*)$ /index.php break;
}

But if I open a seo url like "dev.example.com/test" it redirected to "dev.example.com/" or "dev.example.com/kontakt#startproject" redirected to "dev.example.com/#startproject"

The magic thing, I don't understand is: with the main url it work's very fine! I had no trouble there (Also it's working on any other wordpress page on my plesk installation). I only had that problem with those dev sub domain.

Any idea?
 
Hi,

I want to use nginx as reverse proxy. All images, css and js etc stuff should be handelt by nginx. PHP should rendered by apache.

What is not working? SEO Urls.
It is working for the main domain "example.com" but not for "dev.example.com" and I have no idea why. The configuration for both is the same.
If I open a seo url like "dev.example.com/test" it redirected to "dev.example.com/" or "dev.example.com/kontakt#startproject" redirected to "dev.example.com/#startproject"

Later I want to enable google pagespeed module: PageSpeed Module  |  Google Developers
 
Plesk allows you to do this setting natively, without having to add additional rules in nginx.conf =)

Plesk Panel> Clients> Select Client> Apache & Nginx Settings (choose a domain).

Scroll down the page and check the checkbox: "Processing Static Smart Files". This should enable the setting you want.

About Pagespeed, I strongly suggest you use the official Plesk extension to enable this (via Apache) >>> Google PageSpeed Insights extension - Plesk

I hope my answer has been helpful to you, have a great day! = D
 
Hi,

for example:

I can use this url (non-seo-url): example.com/index.php?pageid=5
Or with a seo-friendly-url: example.com/my-page

So, the Problem is, that nginx returns "404" on any seo-friendly url.
 
Got it, you meant "seo friendly urls" :)

Do the following.
1. Access the directory where your WordPress file is located and delete the ".htaccess" file (you do not need to do anything if this file does not exist).
2. Access your WordPress dashboard. Go to "Settings> Permanent links". Simply click "Save Changes." You do not need to make any changes to this page, just click "Save Changes".

Return me if this worked for you :)
 
I do not want to delete the .htaccess, I need it.
I want that apache works with that .htaccess and I want that apache handled the php requests.

Nginx should only use the images, css and js stuff. Apache do the rest (PHP, .htaccess, etc.)

Any idea?
 
Buddy, you're going to continue using Apache.

What may happen is as follows. Some cache plugin or other configuration in your WordPress may be causing this problem.

In the first step you delete the .htaccess.
But in the second step WordPress will create it again for you.

Please follow the steps I suggested to you and only then provide any additional comments.

If you are hesitant you can always make a backup of .htaccess, although in 99.99% of cases it is not necessary.
 
Back
Top