Mastering Nginx

(Ron) #1

Directive Reference


[ 252 ]

Directive Explanation Context/Default
server_name (http) Configures the names that a
virtual host may respond to.

Valid context: server
Default value: ""
server_name (mail) Sets the name of the server, which
is used in the following ways:


  • The POP3/SMTP server
    greeting

  • The salt for SASL CRAM-
    MD5 authentication

  • The EHLO name when
    using xclient to talk to an
    SMTP backend


Valid contexts: mail,
server
Default value:
hostname

server_name_in_
redirect

Activates using the first value of
the server_name directive in any
redirect issued by NGINX within
this context.

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

server_names_hash_
bucket_size

The bucket size used to hold the
server_name hash tables.

Valid context: http
Default value:
32|64|128 (processor
dependent)
server_names_hash_
max_size

The maximum size of the
server_name hash tables.

Valid context: http
Default value: 512
server_tokens Disables sending the NGINX
version string in error messages
and the Server response header
(default value is on).

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

set Sets a given variable to a specific
value.

Valid context: server,
location, if
Default value: -
set_real_ip_from Defines the connecting address(es)
from which the client IP will be
extracted from the real_ip_
header directive. The value
unix: means that all connections
from UNIX-domain sockets will be
treated this way.

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

smtp_auth Sets the supported SASL client
authentication mechanism. It can
be one or more of login, plain,
or cram-md5.

Valid contexts: mail,
server
Default value: login,
plain
Free download pdf