Any context beginning with the keyword server
is considered a virtual server section. It describes a logical separation of a set of resources that will be delivered under a different server_name
directive. These virtual servers respond to the HTTP requests, and are contained within the http
section.
A virtual server is defined by a combination of the listen
and server_name
directives. The listen
directive defines an IP address/port combination or path to a UNIX-domain socket:
listen address[:port]; listen port; listen unix:path;
The listen
directive uniquely identifies a socket binding under NGINX. There are a number of optional parameters that listen
can take: