Try to rise limits used by master nginx process started with systemd.
As root:
systemctl edit nginx.service
This will open the file /etc/systemd/system/nginx.service.d/override.conf so you need to add two lines between the comments, as shown below:
### Editing /etc/systemd/system/nginx.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Service]
LimitNOFILE=8192
### Lines below this comment will be discarded
### /etc/systemd/system/nginx.service
Save the file and restart nginx
systemctl restart nginx.service
Check again the limits and also nginx:
cat /proc/$(cat /var/run/nginx.pid)/limits | grep -i 'Max open files'
### Editing /etc/systemd/system/nginx.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Service]
LimitNOFILE=500000
### Lines below this comment will be discarded
### /etc/systemd/system/nginx.service
# [Unit]
# Description=nginx - high performance web server
# Documentation=https://nginx.org/en/docs/
# After=network-online.target remote-fs.target nss-lookup.target
# Wants=network-online.target
#
# [Service]
# Type=forking
# PIDFile=/var/run/nginx.pid
# ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
# ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)"
# ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"
# LimitNOFILE=500000
#
# [Install]
# WantedBy=multi-user.target
And I get
Max open files 500000 500000 files
and still
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/var/log/nginx/domains/webmail.mydomain.cx.log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed
in /var/log/hestiadebug.log we have the following error
[ 2023-08-06 19:47:54 | nginx | PROXY ]
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/var/log/nginx/domains/webmail.mydomain.cx.log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed
is there another user accusing when I edit a domain in hestia?