• 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

Nginx + PHP-FPM vs Wordpress Permalinks & Reverse Proxy

ThomasBereczky

New Pleskian
Hey There!

I've meet an issue the permalinks are not working in wordpress if I use Nginx, I was able to solve it by editing the last_nginx.conf but it will be removed when the server reconfigure itself.

I've add this line to the location: try_files $uri $uri/ /index.php?$args;

It's working but I don't want Plesk to reconfigure itself anymore.

Also I've got two subdomains that I edited the last_nginx.conf to link to another server (ip:port) as a reverse proxy server. If it's regenerate the last_nginx.conf all settings will be lost. (These servers are JAVA servers and I need to directly connect to ip:port that is the reason why I used)

Can you give me some advice?
 
Yes.

Can you try via the panel or vhost_nginx.conf...
for now, it only works with non-www websites


location ~ \.php$



{
try_files $uri $uri/ /index.php?$uri&$args;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

if (!-e $request_filename){
rewrite ^(.*)$ /index.php?url=$1 break;
}
 
Last edited:
I'm no LAMP wizard but I too was having the same problem, I found a solution by adding the following to Additional nginx directives:

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

To be honest I do not understand the above command or even if it is superiour to the solution you found. Perhaps someone else would be so kind to elaborate.
 
Back
Top