• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

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