Mastering Nginx

(Ron) #1
Chapter 2

[ 31 ]

Parameter Explanation Comment
deferred Sets the TCP_DEFER_
ACCEPT option to use a
deferred accept() call.

Only supported on Linux.

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

A separate bind() call will
be made implicitly if any
of the other socket-specific
parameters are used.
ipv6only Sets the value of the IPV6_
V6ONLY parameter.

Can only be set on a fresh
start. Not for UNIX-domain
sockets.
ssl Indicates that only HTTPS
connections will be made on
this port.

Allows for a more compact
configuration.

so_keepalive Configures the TCP
keepalive for the listening
socket.

The server_name directive is fairly straightforward, but can be used to solve a number


of configuration problems. Its default value is "", which means that a server section
without a server_name directive will match a request that has no Host header field


set. This can be used, for example, to drop requests that lack this header:


server {

listen 80;

return 444;

}

The non-standard HTTP code, 444 , used in this example will cause NGINX to


immediately close the connection.

Free download pdf