How can I observe what nginx is doing? (to solve: "1024 worker_connections are not enough")

Solution 1:

Without proxy pass / reverse proxy

max_clients = worker_processes * worker_connections

With reverse proxy

max_clients = (worker_processes * worker_connections ) / (X * 2)

2 is because you open a connection to what you are proxying

X is however many concurrent connections these clients make to you

To see which connections are hanging around you could run lsof -i :PORT. It will show all connections open to nginx, and their state.