Ispmanager 6 lite, pro, host

Nginx in ispmanager

How Nginx works

Nginx can be the only web server or work in conjunction with Apache.

If Nginx is the only web server, it processes requests for both static and dynamic site content. Dynamic content, depending on the site language, is generated by:

Nginx uses an asynchronous, event-driven model for handling requests. In this model, a single master process manages multiple child processes, each using a single thread to asynchronously process thousands of connections:

  • master process launches multiple child processes, or workers
  • workers run on behalf of the Nginx user (by default, nginx or www-data), handle static requests, and pass dynamic ones to the handler
  • handler processes run on behalf of the site owner

Changes after Nginx installation

Switching web servers may cause website malfunctions.

  • The Nginx build from ispmanager based on the stable version of the web server is installed.

    If you have version 6.107 ispmanager or lower

    In ispmanager versions 6.107 and below, the default Nginx version from the OS repository is installed. If your ispmanager version is 6.107 or below, you can update Nginx manually. To do this:

    1. Connect to the ispmanager server via SSH.
    2. Execute the following script:
    /usr/local/mgr5/sbin/upgrade_nginx.sh

    Nginx will also be updated automatically when installing the Pagespeed or WAF (ModSecurity) module via the Software configurationWeb server (WWW) section.

    Update is supported for Nginx and its modules installed:

    • from operating system repositories
    • from the official Nginx repository except the nginx-module-geoip and nginx-module-njs modules

    These modules will be removed upon update, which may cause Nginx to malfunction if the directives of these modules were used in the configuration files.

    If Nginx or its modules were installed from third-party repositories or compiled manually, updating may lead to unpredictable consequences.

    In such cases, it is recommended to:

    1. Create a backup copy of the configuration files.
    2. Remove Nginx manually.
    3. Install Nginx via the Software configurationWeb server (WWW) section in ispmanager.
  • Configuration files are prepared. A virtual host is created for each site on the server.
  • If the PHP-FPM module was enabled during installation, the LSAPI and Apache modules are removed for all installed alternative PHP versions and the PHP-FPM module is installed instead.
  • All existing users are granted permission to use PHP in FastCGI (Nginx) mode if they were previously allowed to use PHP in any mode. The default PHP mode is reset. User settings that require Apache, LiteSpeed, or OpenLiteSpeed ​​are reset.
  • All existing sites are converted to work with Nginx. For sites with a PHP handler in any mode, PHP in FastCGI (Nginx) mode is installed. For sites with Python in CGI mode, the Python web server is installed. Site settings that require Apache, LiteSpeed, or OpenLiteSpeed ​​are reset.

Nginx logging

Viewing logs is available to accounts with superuser rights.

Nginx global logs

  • /var/log/nginx/access.log — access log
  • /var/log/nginx/error.log — error log

Site logs

Logs are available if they are enabled for the site.

  • /var/www/httpd-logs/DOMAIN.access.log — access log
  • /var/www/httpd-logs/DOMAIN.error.log — error log

Viewing logs is also available in the WWW request logs section.