worker_rlimit_nofile

Syntax: worker_rlimit_nofile number; Default: — Context: main Changes the limit on the maximum number of open files (RLIMIT_NOFILE) for worker processes. Used to increase the limit without restarting the main process.

worker_rlimit_core

Syntax: worker_rlimit_core size; Default: — Context: main Changes the limit on the largest size of a core file (RLIMIT_CORE) for worker processes. Used to increase the limit without restarting the main process.

worker_priority

Syntax: worker_priority number; Default: worker_priority 0; Context: main Defines the scheduling priority for worker processes like it is done by the nice command: a negative number means higher priority. Allowed range normally varies from -20 to 20. Example: worker_priority -10;

worker_processes

Syntax: worker_processes number | auto; Default: worker_processes 1; Context: main Defines the number of worker processes. The optimal value depends on many factors including (but not limited to) the number of CPU cores, the number of hard disk drives that store data, and load pattern. When one is in doubt, setting it to the number of available CPU cores would be a good start (the value “auto” will try to autodetect it). The auto parameter is supported starting from versions 1.

worker_connections

Syntax: worker_connections number; Default: worker_connections 512; Context: events Sets the maximum number of simultaneous connections that can be opened by a worker process. It should be kept in mind that this number includes all connections (e.g. connections with proxied servers, among others), not only connections with clients. Another consideration is that the actual number of simultaneous connections cannot exceed the current limit on the maximum number of open files, which

worker_cpu_affinity

Syntax: worker_cpu_affinity cpumask ...;worker_cpu_affinity auto [cpumask]; Default: — Context: main Binds worker processes to the sets of CPUs. Each CPU set is represented by a bitmask of allowed CPUs. There should be a separate set defined for each of the worker processes. By default, worker processes are not bound to any specific CPUs. For example, worker_processes 4; worker_cpu_affinity 0001 0010 0100 1000; binds each worker process to a separate CPU, while worker_pr

worker_aio_requests

Syntax: worker_aio_requests number; Default: worker_aio_requests 32; Context: events This directive appeared in versions 1.1.4 and 1.0.7. When using aio with the epoll connection processing method, sets the maximum number of outstanding asynchronous I/O operations for a single worker process.

WebSocket proxying

WebSocket proxying To turn a connection between a client and server from HTTP/1.1 into WebSocket, the protocol switch mechanism available in HTTP/1.1 is used. There is one subtlety however: since the “Upgrade” is a hop-by-hop header, it is not passed from a client to proxied server. With forward proxying, clients may use the CONNECT method to circumvent this issue. This does not work with reverse proxying however, since clients are not aware of any proxy servers, and special processing on a

variables_hash_max_size

Syntax: variables_hash_max_size size; Default: variables_hash_max_size 1024; Context: http Sets the maximum size of the variables hash table. The details of setting up hash tables are provided in a separate document. Prior to version 1.5.13, the default value was 512.

variables_hash_max_size

Syntax: variables_hash_max_size size; Default: variables_hash_max_size 1024; Context: stream This directive appeared in version 1.11.2. Sets the maximum size of the variables hash table. The details of setting up hash tables are provided in a separate document.