Article ID: 127431, created on Nov 14, 2015, last review on Nov 14, 2015

Symptoms

  1. In process list we can see that same domain served by php-fpm and php5-cgi simultaneously:

    # top -c | grep domain.tld
    php-fpm: pool domain.tld
    /usr/bin/php5-cgi -c /var/www/vhosts/system/domain.tld/etc/php.ini
    

Cause

This behavior is caused by two things:

  1. Site is using URL rewrite functions, most CMS (WordPress, Joomla etc.) are using it.
  2. Serve static files directly by nginx option.

    Given option is implemented in ngnix via try_files directive which is checks the existence of files in the specified order and uses the first found file for request processing; the processing is performed in the current context. The path to a file is constructed from the file parameter according to the root and alias directives. If none of the files were found, an internal redirect to the apache is made.

Resolution

  • Modify URL rewrite rules to remove htm or html suffix from URL. This also can be managed via some particular CMS settings.

  • Exclude htm or html or any other extension from static files list in
    Domains > domain.tld > Web Server Settings > nginx settings > Serve static files directly by nginx

alttext

If this option is enabled requests for the listed file extensions will be handled by nginx only and never reach Apache, in case if the file is present on file system. Apache rewrite rules and .htaccess directives will not be applied.

See more information in: - Plesk Administrator's Guide
- Nginx manual

Search Words

php-fpm: pool

Apache rewrite rules

Serve static files

apache cgi and php-fpm

/usr/bin/php5-cgi -c /var/www/vhosts/system/fvu.in.u

htaccess directives are not applied

Email subscription for changes to this article
Save as PDF