Mastering Nginx

(Ron) #1

Directive Reference


[ 236 ]

Directive Explanation Context/Default
lingering_timeout Also in conjunction with
lingering_close, this directive
indicates how long NGINX will
wait for additional data before
closing the client connection.

Valid contexts: http,
server, location
default value: 5s

listen (http) Refer to the listen parameters table
in the section named The virtual
server section in Chapter 2, A
Configuration Guide.

Valid context: server
Default value: *:80 |
*:8000

listen (mail) The listen directive uniquely
identifies a socket binding under
NGINX. It takes the following
parameter:


  • bind: make a separate
    bind() call for this
    address:port pair.


Valid context: server
Default value: -

location Defines a new context based on
the request URI.

Valid context: server,
location
Default value: -
lock_file The prefix name for lock files.
Depending on the platform, a lock
file may be needed to implement
accept_mutex and shared
memory access serialization.

Valid context: main
Default value: logs/
nginx.lock.

log_format Specifies which fields should
appear in the log file and what
format they should take.

Valid context: http
Default value:
combined
$remote_addr


  • $remote_user
    [$time_local],
    "$request"
    $status
    $bodybytes
    sent, "$http
    referer""$http

    user_agent"'
    log_not_found Disables reporting of 404 errors in
    the error log.


Valid contexts: http,
server, location
Default value: on
Free download pdf