Core functionality | ![]() english עברית 日本語 русский türkçe news about download security advisories documentation introduction pgp keys howto faq trac wiki links books support donation nginx.com @nginxorg | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example Configuration
Directives
Determines whether nginx should become a daemon. Mainly used during development.
Enables debugging log for selected client connections.
Other connections will use logging level set by the
error_log directive.
Debugged connections are specified by IPv4 or IPv6 (1.3.0) address or network.
A connection may also be specified using a hostname, in which case the
first IPv4 address corresponding to a name is used.
For connections using UNIX-domain sockets (1.3.0), debugging log is enabled
by the “
For this directive to work, nginx needs to
be built with
Configures logging.
The first parameter defines a file that will store the log.
The special value
The second parameter determines the level of logging.
Log levels above are listed in the order of increasing severity.
Setting a certain log level will cause all messages of
the specified and more severe log levels to be logged.
For example, the default level For
Allows to limit a set of environment variables, change their values, or create new environment variables, for the following cases:
The TZ variable is always inherited and made available to the module ngx_http_perl_module, unless configured explicitly. Usage example: env MALLOC_OPTIONS; env PERL5LIB=/data/site/modules; env OPENSSL_ALLOW_PROXY_CERTS=1;
The NGINX environment variable is used internally by nginx and should not be set directly by the user.
Includes another Usage example: include mime.types; include vhosts/*.conf;
Determines whether worker processes are started. This directive is intended for nginx developers.
This directive appeared in version 1.1.12. Enables or disables the use of “just-in-time compilation” (PCRE JIT) for regular expressions known at configuration parse time. PCRE JIT can speed up processing of regular expressions significantly. The JIT is available in PCRE libraries starting from version 8.20 built with the
Defines a
Defines the name of the hardware SSL accelerator.
Reduces timer resolution in worker processes, thus reducing the
number of Example: timer_resolution 100ms;
An internal implementation of interval depends on the method used:
Defines
Binds worker processes to the sets of CPUs. Each CPU set is represented by a bitmask of allowed to use 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_processes 2; worker_cpu_affinity 0101 1010; binds the first worker process to CPU0/CPU2, and the second worker process to CPU1/CPU3. The second example is suitable for hyper-threading.
The directive is only available on FreeBSD and Linux.
Defines a scheduling priority for worker processes like is
done by the Example: worker_priority -10;
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 in doubt, setting it to the number of available CPU cores would be a good start.
Changes the limit on the largest size of a core file
(
Changes the limit on the maximum number of open files
(
Defines a current working directory for a worker process. It is primarily used when writing a core-file, in which case a worker process should have write permission for the specified directory. |