Code: Select all
[emerg] ... open() "... .error.log" failed (24: Too many open files)
Solution:
To raise the limit without overwriting existing configuration, first check if the override file already exists:
Code: Select all
if [ ! -f "/etc/systemd/system/nginx.service.d/limits.conf" ]; then
mkdir -p /etc/systemd/system/nginx.service.d/
echo "[Service]" > /etc/systemd/system/nginx.service.d/limits.conf
echo "LimitNOFILE=65535" >> /etc/systemd/system/nginx.service.d/limits.conf
fi
Then apply the changes:
Code: Select all
systemctl daemon-reexec
systemctl daemon-reload
systemctl restart nginx