log_format

Syntax: log_format name [escape=default|json] string ...; Default: log_format combined "..."; Context: http Specifies log format. The escape parameter (1.11.8) allows setting json or default characters escaping in variables, by default, default escaping is used. The log format can contain common variables, and variables that exist only at the time of a log write: $bytes_sent the number of bytes sent to a client $connection connection serial number $connection

Logging to syslog

Logging to syslog The error_log and access_log directives support logging to syslog. The following parameters configure logging to syslog: server=address Defines the address of a syslog server. The address can be specified as a domain name or IP address, with an optional port, or as a UNIX-domain socket path specified after the “unix:” prefix. If port is not specified, the UDP port 514 is used. If a domain name resolves to several IP addresses, the first resolved address is used. facilit

lock_file

Syntax: lock_file file; Default: lock_file logs/nginx.lock; Context: main nginx uses the locking mechanism to implement accept_mutex and serialize access to shared memory. On most systems the locks are implemented using atomic operations, and this directive is ignored. On other systems the “lock file” mechanism is used. This directive specifies a prefix for the names of lock files.

location

Syntax: location [ = | ~ | ~* | ^~ ] uri { ... }location @name { ... } Default: — Context: server, location Sets configuration depending on a request URI. The matching is performed against a normalized URI, after decoding the text encoded in the “%XX” form, resolving references to relative path components “.” and “..”, and possible compression of two or more adjacent slashes into a single slash. A location can either be defined by a prefix string, or by a re

load_module

Syntax: load_module file; Default: — Context: main This directive appeared in version 1.9.11. Loads a dynamic module. Example: load_module modules/ngx_mail_module.so;

listen

Syntax: listen address:port [ssl] [udp] [proxy_protocol] [backlog=number] [bind] [ipv6only=on|off] [reuseport] [so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt]]; Default: — Context: server Sets the address and port for the socket on which the server will accept connections. It is possible to specify just the port. The address can also be a hostname, for example: listen 127.0.0.1:12345; listen *:12345; listen 12345; # same as *:12345 l

listen

Syntax: listen address:port [ssl] [backlog=number] [bind] [ipv6only=on|off] [so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt]]; Default: — Context: server Sets the address and port for the socket on which the server will accept requests. It is possible to specify just the port. The address can also be a hostname, for example: listen 127.0.0.1:110; listen *:110; listen 110; # same as *:110 listen localhost:110; IPv6 addresses (0.7.58) are specifi

listen

Syntax: listen address[:port] [default_server] [ssl] [http2 | spdy] [proxy_protocol] [setfib=number] [fastopen=number] [backlog=number] [rcvbuf=size] [sndbuf=size] [accept_filter=filter] [deferred] [bind] [ipv6only=on|off] [reuseport] [so_keepalive=on|off|[keepidle]:[keepintvl]:[keepcnt]];listen port [default_server] [ssl] [http2 | spdy] [proxy_protocol] [setfib=number] [fastopen=number] [backlo

lingering_timeout

Syntax: lingering_timeout time; Default: lingering_timeout 5s; Context: http, server, location When lingering_close is in effect, this directive specifies the maximum waiting time for more client data to arrive. If data are not received during this time, the connection is closed. Otherwise, the data are read and ignored, and nginx starts waiting for more data again. The “wait-read-ignore” cycle is repeated, but no longer than specified by the lingering_time directive.

lingering_time

Syntax: lingering_time time; Default: lingering_time 30s; Context: http, server, location When lingering_close is in effect, this directive specifies the maximum time during which nginx will process (read and ignore) additional data coming from a client. After that, the connection will be closed, even if there will be more data.