Web / NGINX Interview questions
What is the purpose of the events block in NGINX?
The events block, placed at the top level of nginx.conf alongside http, controls how NGINX handles network connections at a low level rather than how it processes HTTP requests.
events { worker_connections 1024; use epoll; multi_accept on; }
worker_connections sets the maximum simultaneous connections each worker process can hold open. use selects the OS-level connection method, such as epoll on Linux, which is what makes NGINX's event loop efficient at scale.
Because it governs connection handling rather than a specific protocol, the events block only ever appears once per configuration and applies globally.
More Related questions...