Mastering Nginx

(Ron) #1

A Configuration Guide


[ 26 ]

Directive Explanation
keepalive_timeout Specifies how long a keep-alive connection
will stay open. A second parameter may
be given, to set a "Keep-Alive" header in
the response.
large_client_header_buffers Defines the maximum number and size of
a large client request header.
msie_padding Enables the disabling of adding comments
to responses with a status greater than
400 for MSIE clients, in order to pad the
response size to 512 bytes.
msie_refresh Enables the sending of a refresh instead of
a redirect for MSIE clients.

File I/O directives


These directives control how NGINX delivers static files and/or how it manages
file descriptors.


Table: HTTP file I/O directives

Directive Explanation
aio Enables the use of asynchronous file I/O.
It is available on all the 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.
directio Enables the operating system specific flag
or function for serving files larger than the
given parameter. It's required when using
aio on Linux.
directio_alignment Sets the alignment for directio. The
default of 512 is usually enough, although
it's recommended to increase this to 4 K
when using XFS on Linux.
open_file_cache Configures a cache that can store open file
descriptors, directory lookups, and file
lookup errors.
open_file_cache_errors Enables the caching of file lookup errors by
open_file_cache.
Free download pdf