Article ID: 126908, created on Sep 15, 2015, last review on Oct 6, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 11.5 for Linux


Option Process PHP through Nginx in Plesk > Domains > domain.tld > Web Server Settings is enabled and WordPress site domain.tld is working fine.

But after configuring Permalinks in WordPress admin > Settings > Permalinks for site domain.tld to Post name all pages except the main one are showing 404 Not Found error.


WordPress permalinks are using .htaccess file to rewrite page urls to http://domain.tld/page_name/.

Nginx is unable to read .htaccess file, this file can be read only by Apache.

When Nginx + php-fpm is set to process php, Apache is not involved into process at all.


There is two possible solutions, the first one will be useful if you want to configure PHP-fpm support for one or several WordPress websites, the second one will be useful if you have a huge amount of subscriptions with this issue.

  1. Create additional nginx directive for domain in Plesk > Domains > domain.tld > Web Server Settings:

    if (!-e $request_filename) {
      rewrite ^.*$ /index.php last;
  2. Create custom configuration template files:

    1. Copy default configuration templates as shown below:

      # mkdir /usr/local/psa/admin/conf/templates/custom
      # mkdir /usr/local/psa/admin/conf/templates/custom/domain
      # mkdir /usr/local/psa/admin/conf/templates/custom/domain/service
      # cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
      # cp /usr/local/psa/admin/conf/templates/default/domain/service/nginxWordpressIndexing.php /usr/local/psa/admin/conf/templates/custom/domain/service/nginxWordpressIndexing.php

      Note that any changes made in default configuration templates will be lost after installation of Plesk microupdates.

    2. In file /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php replace section:

      location ~ /$ {
      <?php echo $VAR->domain->physicalHosting->proxySettings['directoryIndex'] ?>

      with the following one:

      location ~ / {
      index index.php index.cgi index.html index.xhtml index.htm index.shtml;
      try_files $uri $uri/ /index.php?$args;
    3. In file /usr/local/psa/admin/conf/templates/custom/domain/service/nginxWordpressIndexing.php replace

      location ~* "^<?php echo $OPT['ssl'] ? $wordpress->httpsLocation : $wordpress->httpLocation; ?>" {


      location ~* ^/<?php echo $wordpress->location; ?> {
    4. Re-create web-server configuration files:

      # /usr/local/psa/admin/bin/httpdmng --reconfigure-all

Search Words

Process PHP through Nginx

nginx 404 plesk errors

404 error wordpress

php-fpm wordpress

404 not found nginx

a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c 29d1e90fd304f01e6420fbe60f66f838 01bc4c8cf5b7f01f815a7ada004154a2 0a53c5a9ca65a74d37ef5c5eaeb55d7f 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 742559b1631652fadd74764ae8be475e

Email subscription for changes to this article
Save as PDF