Mastering Nginx

(Ron) #1

Directive Reference


[ 216 ]

Directive Explanation Context/Default
access_log Describes where and how
access logs are to be written.
The first parameter is a path to
the file where the logs are to be
stored. Variables may be used in
constructing the path. The special
value off disables the access log.
An optional second parameter
indicates the log_format that
will be used to write the logs. If no
second parameter is configured,
the predefined combined format is
used. An optional third parameter
indicates the size of the buffer if
write buffering should be used to
record the logs. If write buffering
is used, this size cannot exceed the
size of the atomic disk write for
that filesystem.

Valid contexts: http,
server, location,
if in location,
limit_except
Default value:
logs/access.log
combined

add_after_body Adds the result of processing
a subrequest after the response
body.

Valid context:
location
Default value: -
add_before_body Adds the result of processing a
subrequest before the response
body.

Valid context:
location
Default value: -
add_header Adds fields to a header present in
responses with the HTTP codes
200, 204, 206, 301, 302, 303, 304, or
307.

Valid contexts: http,
server, location
Default value: -

addition_types Lists the MIME types of a response
in addition to text/html, in
which an addition will be made.
May be * to enable all
MIME types.

Valid contexts: http,
server, location
Default value: text/
html

aio This directive enables the use
of asynchronous file I/O. It is
available on all modern versions
of FreeBSD and distributions
of Linux. On FreeBSD, aio
may be used to preload data
for sendfile. Under Linux,
directio is required, which
automatically disables sendfile.

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