- Plesk for Linux
When nginx support is enabled and there are a lot of domains (more than 256), nginx will fail with the following error:
2012-11-08T20:13:34+07:00 ERR (3): Apache config (13523804010.47553900) generation failed: nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed
Incorrect SSL certificate is assigned to the domain.
- SSL certificate is not updated: after SSL certificate is changed in Plesk old certificate is shown in a web-browser.
Nginx's virtual host opens 4 log files for each virtual host with physical hosting:
As a result of this fact, the maximum number of open files is exceeded by nginx server.
- Connect to the server using SSH
Set the required
ULIMITvalue in the nginx configuration:
# echo 'NGINX_ULIMIT="-n 4096"' >> /etc/default/nginx
# echo 'NGINX_ULIMIT="-n 4096"' >> /etc/sysconfig/nginx
worker_rlimit_nofilevalue in the nginx configuration to increase the maximum number of opened files allowed by the worker process:
# grep "worker_rlimit_nofile" /etc/nginx/nginx.conf
- This step should be done for systems using systemd only (instead of SysV and LSB):
LimitNOFILEshould be increased in
[Service]section. To do so, modify
systemddaemon should be reloaded after any changes in the unit configuration files:
# systemctl --system daemon-reload
# service nginx restart
Regenerate the web server configuration:
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Note: If execution of
nginx -t command still produces
Too many open files error, check limits for
root user in
/etc/security/limits.conf configuration file and increase them as well.