Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

nginx fails to start/reload on a Plesk server: Too many open files

 
apachedomainsdowntimehostedhosting

Symptoms

  • The nginx service fails to start/reload with the following error in the /var/log/nginx/error.log file:

    nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log" failed (24: Too many open files)

  • Some or all websites are not accessible

  • Warning is shown in the Tools & Settings > Diagnose & repair:

    Checking for nginx ULIMIT value N domains have been found on server. Problem with nginx default limit for open files is possible

  • NodeJS and Ruby web applications are showing 502 Bad Gateway error when performing some Plesk tasks such as creating domains, subscriptions, changes on Apache or Nginx, etc:

    Server Error
    502 Bad Gateway
    Web server received an invalid response while acting as a gateway or proxy server.

  • After installing a new certificate for the domain, the old one is still shown in a web browser, however, the correct certificate is selected at the Domains > example.com > Hosting Settings page.

Cause

Nginx's virtual host opens 4 log files for each virtual host with physical hosting:

  • proxy_access_log
  • proxy_access_ssl_log
  • webmail_access_log
  • webmail_access_ssl_log

As a result of this fact, the maximum number of open files is exceeded by the nginx server due to a big number of domains (usually, more than 100).

Resolution

Warning: Execution of the websrv_ulimits utility without --no-restart option initiates rebuilding of web configuration files for all domains and can cause significant downtime in case of a big number of hosted websites.

Execute the command during the maintenance time frame.

It is good practice to set open files limit value more than number of domains in Plesk * 16 at least. In example below provided actions how to set limit to 4096:

  1. Connect to the server via SSH

  2. Set open files limit to 4096 for both Apache and Nginx:

    # /usr/local/psa/admin/sbin/websrv_ulimits --set 4096 --no-restart

  3. Restart Apache and nginx services at Plesk > Tools & Settings > Services Management to apply changes.

  4. Check that 'Max open files limit' was applied properly, after web services restarting:

    # grep 'Max open files' /proc/$(cat /var/run/nginx.pid)/limits
    Max open files 4096 4096 file

  5. If the solution above did not help, set the limit using the ulimit utility:

    # ulimit -n 4096

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Securing the WordPress Frontier with WP Guardian

Read More »

Introducing WP Guardian Vulnerability Protection: Now available for WP Toolkit

Read More »

Your Complete .htaccess Guide: Including .htaccess Basics and More

Read More »
Knowledge Base

A website or webmail hosted in Plesk periodically shows the Plesk/web server default page or old website content

Read More »

Unable to start Apache/nginx on a Plesk server: AH02291: Cannot access directory for error log of vhost

Read More »

How to open a website that exists in Plesk, but is not yet resolving to the Plesk server?

Read More »

Pages of a website hosted in Plesk fail to load: Size of a request header field exceeds server limit

Read More »

Hosting Wiki

  • Server Redundancy
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • Ruby On Rails
  • Domain
  • Hosting Control Panel
  • Plesk
  • Apache Tomcat
  • NGINX
  • Apache
  • Web Server
  • DNS Server
  • SSH
  • Colocation Hosting
  • Reseller Hosting
  • Cloud Hosting
  • VPS Hosting
  • Dedicated Hosting
  • Shared Hosting
  • Free Hosting
  • Managed Hosting
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family