+2 votes
in Web & Google by (8.1k points)

I installed Nginx as reverse proxy on Apache server. I did not make any change in the configuration file of Nginx, but I see the following error in the log file of Nginx. How can I fix it?

2018/06/17 22:25:05 [warn] 5119#5119: 4096 worker_connections exceed open file resource limit: 1024

1 Answer

+1 vote
by (15.8k points)

It seems that in the configuration file of Nginx (nginx.conf), you have "worker_connections 4096;", but on your server machine, there is hard limit of 1024 on open file resource.

If you can SSH to your server, run "ulimit -n" on the terminal to see the limit on open files. You can run "ulimit -a" to check other limitations. If the limit on open files is 1024, make the following change in nginx.conf file: "worker_connections 1024;"

Although Nginx documentation says that worker_rlimit_nofile can be used to increase the limit, but it never worked on my VPS.

...