Distribution defaults for nginx.conf are conservative. A few main and http settings improve throughput and remove information leaks before you write a single server block.
worker_processes auto matches CPU cores. worker_connections sets the per-worker limit.
worker_processes auto;
events {
worker_connections 4096;
}Turn off server_tokens, enable sendfile and tcp_nopush, set keepalive_timeout and a log format you can parse.
http {
server_tokens off;
sendfile on;
tcp_nopush on;
keepalive_timeout 30s;
}Total clients is roughly worker_processes times worker_connections, halved when proxying because each client uses two connections. Also check the open-files limit.