comparison xml/en/docs/http/ngx_http_core_module.xml @ 628:779a47d0acb0

Unified terminology used in the "server_name" directive and server_names.xml.
author Vladimir Homutov <vl@nginx.com>
date Mon, 13 Aug 2012 08:22:19 +0000
parents af23cb587b00
children eba81bfb6aaf
comparison
equal deleted inserted replaced
627:af23cb587b00 628:779a47d0acb0
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9 9
10 <module name="Module ngx_http_core_module" 10 <module name="Module ngx_http_core_module"
11 link="/en/docs/http/ngx_http_core_module.html" 11 link="/en/docs/http/ngx_http_core_module.html"
12 lang="en" 12 lang="en"
13 rev="1"> 13 rev="2">
14 14
15 <section id="directives" name="Directives"> 15 <section id="directives" name="Directives">
16 16
17 <directive name="aio"> 17 <directive name="aio">
18 <syntax> 18 <syntax>
2113 </example> 2113 </example>
2114 </para> 2114 </para>
2115 2115
2116 <para> 2116 <para>
2117 The first name becomes the primary server name. 2117 The first name becomes the primary server name.
2118 </para>
2119
2120 <para>
2118 Server names can include an asterisk (“<literal>*</literal>”) 2121 Server names can include an asterisk (“<literal>*</literal>”)
2119 to replace the first or last part of a name: 2122 to replace the first or last part of a name:
2120 <example> 2123 <example>
2121 server { 2124 server {
2122 server_name example.com *.example.com www.example.*; 2125 server_name example.com *.example.com www.example.*;
2123 } 2126 }
2124 </example> 2127 </example>
2128 Such names are called wildcard names.
2125 </para> 2129 </para>
2126 2130
2127 <para> 2131 <para>
2128 The first two of the above mentioned names can be combined: 2132 The first two of the above mentioned names can be combined:
2129 <example> 2133 <example>
2130 server { 2134 server {
2131 server_name .example.com; 2135 server_name .example.com;
2132 } 2136 }
2133 </example> 2137 </example>
2134 </para>
2135
2136 <para>
2137 If the parameter equals “<var>$hostname</var>” (0.9.4), the
2138 machine’s hostname is substituted.
2139 </para> 2138 </para>
2140 2139
2141 <para> 2140 <para>
2142 It is also possible to use regular expressions in server names, 2141 It is also possible to use regular expressions in server names,
2143 prepending the name with a tilde (“<literal>~</literal>”): 2142 prepending the name with a tilde (“<literal>~</literal>”):
2188 location / { 2187 location / {
2189 root /sites/default; 2188 root /sites/default;
2190 } 2189 }
2191 } 2190 }
2192 </example> 2191 </example>
2192 </para>
2193
2194 <para>
2195 If the parameter equals “<var>$hostname</var>” (0.9.4), the
2196 machine’s hostname is substituted.
2193 </para> 2197 </para>
2194 2198
2195 <para> 2199 <para>
2196 It is also possible to specify an empty server name (0.7.11): 2200 It is also possible to specify an empty server name (0.7.11):
2197 <example> 2201 <example>
2208 </para> 2212 </para>
2209 2213
2210 <para> 2214 <para>
2211 When searching for a virtual server by name, 2215 When searching for a virtual server by name,
2212 if name matches more than one of the specified variants, 2216 if name matches more than one of the specified variants,
2213 e.g. both mask and regular expression match, the first matching 2217 e.g. both wildcard name and regular expression match, the first matching
2214 variant will be chosen, in the following order of precedence: 2218 variant will be chosen, in the following order of precedence:
2215 <list type="enum"> 2219 <list type="enum">
2216 2220
2217 <listitem> 2221 <listitem>
2218 full name 2222 exact name
2219 </listitem> 2223 </listitem>
2220 2224
2221 <listitem> 2225 <listitem>
2222 longest name with a prefix mask, 2226 longest wildcard name starting with an asterisk,
2223 e.g. “<literal>*.example.com</literal>” 2227 e.g. “<literal>*.example.com</literal>”
2224 </listitem> 2228 </listitem>
2225 2229
2226 <listitem> 2230 <listitem>
2227 longest name with a suffix mask, 2231 longest wildcard name ending with an asterisk,
2228 e.g. “<literal>mail.*</literal>” 2232 e.g. “<literal>mail.*</literal>”
2229 </listitem> 2233 </listitem>
2230 2234
2231 <listitem> 2235 <listitem>
2232 first matching regular expression 2236 first matching regular expression
2233 (in order of appearance in a configuration file) 2237 (in order of appearance in a configuration file)
2234 </listitem> 2238 </listitem>
2235 2239
2236 </list> 2240 </list>
2241 </para>
2242
2243 <para>
2244 For more information, please refer to the
2245 <link doc="server_names.xml"/> document.
2237 </para> 2246 </para>
2238 2247
2239 </directive> 2248 </directive>
2240 2249
2241 2250