annotate xml/en/docs/http/server_names.xml @ 623:7158aa1ec520

Added special server name '$hostname' description.
author Vladimir Homutov <vl@nginx.com>
date Fri, 10 Aug 2012 09:35:38 +0000
parents 13f64b371d2c
children af3f38e349eb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 490
diff changeset
1 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 490
diff changeset
2 Copyright (C) Igor Sysoev
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 490
diff changeset
3 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 490
diff changeset
4 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 490
diff changeset
5
50
9d544687d02c Fixed DOCTYPE declaration.
Ruslan Ermilov <ru@nginx.com>
parents: 0
diff changeset
6 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
7
123
7db449e89e92 Unified the use of the "name" attribute instead of "title".
Ruslan Ermilov <ru@nginx.com>
parents: 121
diff changeset
8 <article name="Server names"
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
9 link="/en/docs/http/server_names.html"
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
10 lang="en"
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
11 rev="2"
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
12 author="Igor Sysoev"
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
13 editor="Brian Mercer">
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16 <section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
17
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
18 <para>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
19 Server names are defined using the
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
20 <link doc="ngx_http_core_module.xml" id="server_name"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
21 directive
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
22 and determine which <link doc="ngx_http_core_module.xml" id="server"/> block
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
23 is used for a given request.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
24 See also “<link doc="request_processing.xml"/>”.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25 They may be defined using exact names, wildcard names, or regular expressions:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
29 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
30 server_name example.org www.example.org;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
32 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
36 server_name *.example.org;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
40 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41 listen 80;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42 server_name mail.*;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
44 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
46 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
47 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
48 server_name ~^(?&lt;user&gt;.+)\.example\.net$;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
49 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
50 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
51 </programlisting>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
52 </para>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
53
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
54 <para>
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
55 When searching for a virtual server by name, if name matches more than one of
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
56 the specified variants, e.g. both wildcard name and regular expression match,
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
57 the first matching variant will be chosen, in the following order of precedence:
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
58 <list type="enum">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
59
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
60 <listitem>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
61 exact name
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
62 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
63
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
64 <listitem>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
65 longest wildcard name starting with an asterisk, e.g.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
66 “<literal>*.example.org</literal>”
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
67 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
68
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
69 <listitem>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
70 longest wildcard name ending with an asterisk, e.g. “<literal>mail.*</literal>”
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
71 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
72
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
73 <listitem>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
74 first matching regular expression
622
13f64b371d2c removed dot after list item
Vladimir Homutov <vl@nginx.com>
parents: 621
diff changeset
75 (in order of appearance in a configuration file)
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
76 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
77
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
78 </list>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
79 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
80
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
81 </section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
82
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
83
121
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
84 <section id="wildcard_names"
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
85 name="Wildcard names">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
86
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
87 <para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
88 A wildcard name may contain an asterisk only on the name's start or end,
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
89 and only on a dot border. The names “<literal>www.*.example.org</literal>”
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
90 and “<literal>w*.example.org</literal>” are invalid.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
91 However, these names can be specified using regular expressions,
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
92 for example, “<literal>~^www\..+\.example\.org$</literal>” and
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
93 “<literal>~^w.*\.example\.org$</literal>”.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
94 An asterisk can match several name parts.
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
95 The name “<literal>*.example.org</literal>” matches not only
593
130fad6dc1b4 Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents: 589
diff changeset
96 <literal>www.example.org</literal> but <literal>www.sub.example.org</literal> as well.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
97 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
98
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
99 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
100 A special wildcard name in the form “<literal>.example.org</literal>” can be
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
101 used to match both the exact name “<literal>example.org</literal>”
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
102 and the wildcard name “<literal>*.example.org</literal>”.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
103 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
104
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
105 </section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
106
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
107
121
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
108 <section id="regex_names"
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
109 name="Regular expressions names">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
110
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
111 <para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
112 The regular expressions used by nginx are compatible with those used
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
113 by the Perl programming language (PCRE).
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
114 To use a regular expression, the server name must start with the tilde
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
115 character:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
116
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
117 <programlisting>
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
118 server_name ~^www\d+\.example\.net$;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
121 otherwise it will be treated as an exact name, or if the expression contains
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
122 an asterisk, as a wildcard name (and most likely as an invalid one).
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
123 Do not forget to set “<literal>^</literal>” and “<literal>$</literal>” anchors.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 They are not required syntactically, but logically.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
125 Also note that domain name dots should be escaped with a backslash.
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
126 A regular expression containing the characters “<literal>{</literal>”
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
127 and “<literal>}</literal>” should be quoted:
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
128
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129 <programlisting>
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
130 server_name "~^(?&lt;name&gt;\w\d<b>{</b>1,3<b>}</b>+)\.example\.net$";
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
131 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
132
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
133 otherwise nginx will fail to start and display the error message:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
134
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
135 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
136 directive "server_name" is not terminated by ";" in ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
137 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
138
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
139 A named regular expression capture can be used later as a variable:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
140
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
141 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
142 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
143 server_name ~^(www\.)?(<b>?&lt;domain&gt;</b>.+)$;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
144
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
145 location / {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
146 root /sites/<b>$domain</b>;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
147 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
148 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
149 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
150
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
151 The PCRE library supports named captures using the following syntax:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
152
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
153 <table note="yes">
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
154
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
155 <tr>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
156 <td><literal>?&lt;<value>name</value>&gt;</literal></td>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
157 <td>Perl 5.10 compatible syntax, supported since PCRE-7.0</td>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
158 </tr>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
159
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
160 <tr>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
161 <td><literal>?'<value>name</value>'</literal></td>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
162 <td>Perl 5.10 compatible syntax, supported since PCRE-7.0</td>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
163 </tr>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
164
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
165 <tr>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
166 <td><literal>?P&lt;<value>name</value>&gt;</literal></td>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
167 <td>Python compatible syntax, supported since PCRE-4.0</td>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
168 </tr>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
169
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
170 </table>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
171
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
172 If nginx fails to start and displays the error message:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
173
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
174 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
175 pcre_compile() failed: unrecognized character after (?&lt; in ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
176 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
177
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
178 this means that the PCRE library is old and the syntax
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
179 “<literal>?P&lt;<value>name</value>&gt;</literal>” should be tried instead.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
180 The captures can also be used in digital form:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
181
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
182 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
183 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
184 server_name ~^(www\.)?(.+)$;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
185
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
186 location / {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
187 root /sites/<b>$2</b>;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
188 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
189 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
190 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
191
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
192 However, such usage should be limited to simple cases (like the above),
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
193 since the digital references can easily be overwritten.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
194 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
195
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
196
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
197 </section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
198
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
199
121
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
200 <section id="miscellaneous_names"
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
201 name="Miscellaneous names">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
202
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
203 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
204 There are some server names that are treated specially.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
205 </para>
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
206
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
207 <para>
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
208 If it is required to process requests without the <header>Host</header>
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
209 header field in a <link doc="ngx_http_core_module.xml" id="server"/>
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
210 block which is not the default, an empty name should be specified:
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
211
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
212 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
213 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
214 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
215 server_name example.org www.example.org "";
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
216 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
217 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
218 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
219 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
220
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
221 <para>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
222 If no
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
223 <link doc="ngx_http_core_module.xml" id="server_name"/>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
224 is defined in a <link doc="ngx_http_core_module.xml" id="server"/> block
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
225 then nginx uses the empty name as the server name.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
226 <note>
623
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
227 nginx versions up to 0.8.48 used the machine’s hostname as the server name
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
228 in this case.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
229 </note>
623
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
230 If a server name is defined as “<literal>$hostname</literal>” (0.9.4), the
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
231 machine’s hostname is used.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
232 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
233
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
234 <para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
235 If someone makes a request using an IP address instead of a server name,
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
236 the <header>Host</header> request header field will contain the IP address
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
237 and the request can be handled using the IP address as the server name:
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
238
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
239 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
240 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
241 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
242 server_name example.org
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
243 www.example.org
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
244 ""
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
245 <b>192.168.1.1</b>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
246 ;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
247 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
248 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
249 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
250 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
251
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
252 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
253 In catch-all server examples the strange name “<literal>_</literal>” can
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
254 be seen:
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
255
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
256 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
257 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
258 listen 80 default_server;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
259 server_name _;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
260 return 444;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
261 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
262 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
263
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
264 There is nothing special about this name, it is just one of a myriad
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
265 of invalid domain names which never intersect with any real name.
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
266 Other invalid names like “<literal>--</literal>” and “<literal>!@#</literal>”
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
267 may equally be used.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
268 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
269
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
270 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
271 nginx versions up to 0.6.25 supported the special name “<literal>*</literal>”
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
272 which was erroneously interpreted to be a catch-all name.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
273 It never functioned as a catch-all or wildcard server name.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
274 Instead, it supplied the functionality that is now provided
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
275 by the
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
276 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
277 directive.
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
278 The special name “<literal>*</literal>” is now deprecated
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
279 and the
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
280 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
281 directive should be used.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
282 Note that there is no way to specify the catch-all name or
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
283 the default server using the
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
284 <link doc="ngx_http_core_module.xml" id="server_name"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
285 directive.
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
286 This is a property of the
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
287 <link doc="ngx_http_core_module.xml" id="listen"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
288 directive
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
289 and not of the
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
290 <link doc="ngx_http_core_module.xml" id="server_name"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
291 directive.
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
292 See also “<link doc="request_processing.xml"/>”.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
293 It is possible to define servers listening on ports *:80 and *:8080,
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
294 and direct that one will be the default server for port *:8080,
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
295 while the other will be the default for port *:80:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
296
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
297 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
298 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
299 listen 80;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
300 listen 8080 default_server;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
301 server_name example.net;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
302 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
303 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
304
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
305 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
306 listen 80 default_server;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
307 listen 8080;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
308 server_name example.org;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
309 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
310 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
311 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
312 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
313
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
314
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
315 </section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
316
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
317
121
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
318 <section id="optimization"
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
319 name="Optimization">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
320
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
321 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
322 Exact names, wildcard names starting with an asterisk,
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
323 and wildcard names ending with an asterisk are stored
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
324 in three hash tables bound to the listen ports.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
325 The sizes of hash tables are optimized at the configuration phase
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
326 so that a name can be found with the fewest CPU cache misses.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
327 See also “<link doc="../hash.xml"/>”.
618
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
328 </para>
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
329
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
330 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
331 The exact names hash table is searched first.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
332 If a name is not found, the hash table with wildcard names
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
333 starting with an asterisk is searched.
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
334 If the name is not found there, the hash table with wildcard names
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
335 ending with an asterisk is searched.
618
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
336 </para>
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
337
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
338 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
339 Searching wildcard names hash table is slower than searching exact names hash
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
340 table because names are searched by domain parts.
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
341 Note that the special wildcard form “<literal>.example.org</literal>”
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
342 is stored in a wildcard names hash table and not in an exact names hash table.
618
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
343 </para>
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
344
2300e4c1a231 Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents: 593
diff changeset
345 <para>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
346 Regular expressions are tested sequentially
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
347 and therefore are the slowest method and are non-scalable.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
348 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
349
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
350 <para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
351 For these reasons, it is better to use exact names where possible.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
352 For example, if the most frequently requested names of a server
593
130fad6dc1b4 Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents: 589
diff changeset
353 are <literal>example.org</literal> and <literal>www.example.org</literal>,
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
354 it is more efficient to define them explicitly:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
355
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
356 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
357 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
358 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
359 server_name example.org www.example.org *.example.org;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
360 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
361 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
362 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
363
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
364 than to use the simplified form:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
365
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
366 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
367 server {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
368 listen 80;
490
9913f1d51c07 Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents: 461
diff changeset
369 server_name .example.org;
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
370 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
371 }
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
372 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
373 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
374
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
375 <para>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
376 If a large number of server names are defined,
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
377 or unusually long server names are defined, tuning
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
378 the <link doc="ngx_http_core_module.xml" id="server_names_hash_max_size"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
379 and <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
380 directives at the <i>http</i> level may become necessary.
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
381 The default value of the
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
382 <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
383 may be equal to 32, or 64, or another value,
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
384 depending on CPU cache line size.
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
385 If the default value is 32 and server name is defined as
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
386 “<literal>too.long.server.name.example.org</literal>”
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
387 then nginx will fail to start and display the error message:
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
388
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
389 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
390 could not build the server_names_hash,
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
391 you should increase server_names_hash_bucket_size: 32
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
392 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
393
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
394 In this case, the directive value should be increased to the next power of two:
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
395
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
396 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
397 http {
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
398 server_names_hash_bucket_size 64;
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
399 ...
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
400 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
401
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
402 If a large number of server names are defined,
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
403 another error message will appear:
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
404
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
405 <programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
406 could not build the server_names_hash,
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
407 you should increase either server_names_hash_max_size: 512
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
408 or server_names_hash_bucket_size: 32
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
409 </programlisting>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
410
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
411 In such a case, first try to set
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
412 <link doc="ngx_http_core_module.xml" id="server_names_hash_max_size"/>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
413 to a number close to the number of server names.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
414 Only if this does not help,
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
415 or if nginx’s start time is unacceptably long, try to increase
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
416 <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/>.
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
417 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
418
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
419 <para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
420 If a server is the only server for a listen port, then nginx will not test
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
421 server names at all (and will not build the hash tables for the listen port).
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
422 However, there is one exception.
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
423 If a
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
424 <link doc="ngx_http_core_module.xml" id="server_name"/>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 123
diff changeset
425 is a regular expression with captures,
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
426 then nginx has to execute the expression to get the captures.
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
427 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
428
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
429 </section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
430
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
431
121
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
432 <section id="compatibility"
49443032011c Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents: 50
diff changeset
433 name="Compatibility">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
434
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
435 <para>
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
436 <list type="bullet">
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
437
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
438 <listitem>
623
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
439 The special server name “<literal>$hostname</literal>” has been supported
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
440 since 0.9.4.
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
441 </listitem>
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
442
7158aa1ec520 Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents: 622
diff changeset
443 <listitem>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
444 A default server name value is an empty name “” since 0.8.48.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
445 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
446
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
447 <listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
448 Named regular expression server name captures have been supported since 0.8.25.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
449 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
450
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
451 <listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
452 Regular expression server name captures have been supported since 0.7.40.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
453 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
454
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
455 <listitem>
621
656dfb085020 Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents: 618
diff changeset
456 An empty server name “” has been supported since 0.7.12.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
457 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
458
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
459 <listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
460 A wildcard server name or regular expression has been supported for use
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
461 as the first server name since 0.6.25.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
462 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
463
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
464 <listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
465 Regular expression server names have been supported since 0.6.7.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
466 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
467
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
468 <listitem>
593
130fad6dc1b4 Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents: 589
diff changeset
469 Wildcard form <literal>example.*</literal> has been supported since 0.6.0.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
470 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
471
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
472 <listitem>
593
130fad6dc1b4 Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents: 589
diff changeset
473 The special form <literal>.example.org</literal> has been supported since 0.3.18.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
474 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
475
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
476 <listitem>
593
130fad6dc1b4 Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents: 589
diff changeset
477 Wildcard form <literal>*.example.org</literal> has been supported since 0.1.13.
461
6135f3c95bf6 Unified markup for lists.
Ruslan Ermilov <ru@nginx.com>
parents: 374
diff changeset
478 </listitem>
0
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
479
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
480 </list>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
481 </para>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
482
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
483 </section>
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
484
61e04fc01027 Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
485 </article>