If you are setting up nginx,chances are you will discover your worker_connections is at some low number, such as 1024.
You can’t increase this number unless you increase kernel limit as well.
First of all run cat /proc/sys/fs/file-max
to discover your maximum limit.
abc@ubuntu:~$ cat /proc/sys/fs/file-max
1048576
abc@ubuntu:~$ ulimit -n
1024