Mercurial > hg > nginx-site
annotate xml/en/docs/http/server_names.xml @ 2045:ae16f480c867
Fixed links in yaml script to accept folded block scalars (>).
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Wed, 06 Sep 2017 15:15:40 +0300 |
parents | 30e2bd353998 |
children | c56adb7148a4 |
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 | 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" |
2042
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
11 rev="3" |
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 | 19 Server names are defined using the |
20 <link doc="ngx_http_core_module.xml" id="server_name"/> | |
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 ~^(?<user>.+)\.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 | 58 <list type="enum"> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 |
461 | 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 | 62 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 |
461 | 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 | 67 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 |
461 | 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 | 71 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 |
461 | 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 | 76 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 |
461 | 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> |
625
af3f38e349eb
Removed terminal whitespace and fixed apostrophes used.
Ruslan Ermilov <ru@nginx.com>
parents:
623
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 "~^(?<name>\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>?<domain></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 | 156 <td><literal>?<<value>name</value>></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 | 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 | 166 <td><literal>?P<<value>name</value>></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 (?< 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<<value>name</value>></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 | 222 If no |
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> |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
625
diff
changeset
|
230 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
625
diff
changeset
|
231 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
625
diff
changeset
|
232 <para> |
623
7158aa1ec520
Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents:
622
diff
changeset
|
233 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
|
234 machine’s hostname is used. |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
235 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
236 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
237 <para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
238 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
|
239 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
|
240 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
|
241 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
242 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
243 server { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
244 listen 80; |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
245 server_name example.org |
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
246 www.example.org |
0
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 <b>192.168.1.1</b> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
249 ; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
250 ... |
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 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
253 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
254 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
255 <para> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
256 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
|
257 be seen: |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
258 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
259 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
260 server { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
261 listen 80 default_server; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
262 server_name _; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
263 return 444; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
264 } |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
265 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
266 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
267 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
|
268 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
|
269 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
|
270 may equally be used. |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
271 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
272 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
273 <para> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
274 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
|
275 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
|
276 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
|
277 Instead, it supplied the functionality that is now provided |
271 | 278 by the |
279 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/> | |
280 directive. | |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
281 The special name “<literal>*</literal>” is now deprecated |
271 | 282 and the |
283 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/> | |
284 directive should be used. | |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
285 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
|
286 the default server using the |
271 | 287 <link doc="ngx_http_core_module.xml" id="server_name"/> |
288 directive. | |
289 This is a property of the | |
290 <link doc="ngx_http_core_module.xml" id="listen"/> | |
291 directive | |
292 and not of the | |
293 <link doc="ngx_http_core_module.xml" id="server_name"/> | |
294 directive. | |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
295 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
|
296 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
|
297 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
|
298 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
|
299 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
300 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
301 server { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
302 listen 80; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
303 listen 8080 default_server; |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
304 server_name example.net; |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
305 ... |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
306 } |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
307 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
308 server { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
309 listen 80 default_server; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
310 listen 8080; |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
311 server_name example.org; |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
312 ... |
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 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
315 </para> |
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 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
318 </section> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
319 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
320 |
2042
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
321 <section id="idn" |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
322 name="Internationalized names"> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
323 <para> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
324 Internationalized domain names |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
325 (<link url="https://en.wikipedia.org/wiki/Internationalized_domain_name">IDNs</link>) |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
326 should be specified using an ASCII (Punycode) representation |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
327 in the <link doc="ngx_http_core_module.xml" id="server_name"/> directive: |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
328 <programlisting> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
329 server { |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
330 listen 80; |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
331 server_name xn--e1afmkfd.xn--80akhbyknj4f; # пример.испытание |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
332 ... |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
333 } |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
334 </programlisting> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
335 </para> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
336 |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
337 </section> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
338 |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
339 |
121
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
50
diff
changeset
|
340 <section id="optimization" |
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
50
diff
changeset
|
341 name="Optimization"> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
342 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
343 <para> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
344 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
|
345 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
|
346 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
|
347 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
|
348 so that a name can be found with the fewest CPU cache misses. |
966 | 349 The details of setting up hash tables are provided in a separate |
659
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
645
diff
changeset
|
350 <link doc="../hash.xml">document</link>. |
618
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
351 </para> |
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
352 |
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
353 <para> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
354 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
|
355 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
|
356 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
|
357 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
|
358 ending with an asterisk is searched. |
618
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
359 </para> |
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
360 |
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
361 <para> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
362 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
|
363 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
|
364 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
|
365 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
|
366 </para> |
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
367 |
2300e4c1a231
Improved paragraph layout in the 'Optimization' section
Vladimir Homutov <vl@nginx.com>
parents:
593
diff
changeset
|
368 <para> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
369 Regular expressions are tested sequentially |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
370 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
|
371 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
372 |
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 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
|
375 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
|
376 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
|
377 it is more efficient to define them explicitly: |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
378 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
379 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
380 server { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
381 listen 80; |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
382 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
|
383 ... |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
384 } |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
385 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
386 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
387 than to use the simplified form: |
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 server { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
391 listen 80; |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
392 server_name .example.org; |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
393 ... |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
394 } |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
395 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
396 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
397 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
398 <para> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
399 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
|
400 or unusually long server names are defined, tuning |
271 | 401 the <link doc="ngx_http_core_module.xml" id="server_names_hash_max_size"/> |
402 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
|
403 directives at the <i>http</i> level may become necessary. |
271 | 404 The default value of the |
405 <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/> | |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
625
diff
changeset
|
406 directive 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
|
407 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
|
408 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
|
409 “<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
|
410 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
|
411 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
412 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
413 could not build the server_names_hash, |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
414 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
|
415 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
416 |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
417 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
|
418 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
419 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
420 http { |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
421 server_names_hash_bucket_size 64; |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
422 ... |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
423 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
424 |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
425 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
|
426 another error message will appear: |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
427 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
428 <programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
429 could not build the server_names_hash, |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
430 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
|
431 or server_names_hash_bucket_size: 32 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
432 </programlisting> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
433 |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
434 In such a case, first try to set |
271 | 435 <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
|
436 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
|
437 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
|
438 or if nginx’s start time is unacceptably long, try to increase |
271 | 439 <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
|
440 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
441 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
442 <para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
443 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
|
444 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
|
445 However, there is one exception. |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
625
diff
changeset
|
446 If a server name is a regular expression with captures, |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
447 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
|
448 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
449 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
450 </section> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
451 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
452 |
121
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
50
diff
changeset
|
453 <section id="compatibility" |
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
50
diff
changeset
|
454 name="Compatibility"> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
455 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
456 <para> |
461 | 457 <list type="bullet"> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
458 |
461 | 459 <listitem> |
623
7158aa1ec520
Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents:
622
diff
changeset
|
460 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
|
461 since 0.9.4. |
7158aa1ec520
Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents:
622
diff
changeset
|
462 </listitem> |
7158aa1ec520
Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents:
622
diff
changeset
|
463 |
7158aa1ec520
Added special server name '$hostname' description.
Vladimir Homutov <vl@nginx.com>
parents:
622
diff
changeset
|
464 <listitem> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
465 A default server name value is an empty name “” since 0.8.48. |
461 | 466 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
467 |
461 | 468 <listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
469 Named regular expression server name captures have been supported since 0.8.25. |
461 | 470 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
471 |
461 | 472 <listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
473 Regular expression server name captures have been supported since 0.7.40. |
461 | 474 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
475 |
461 | 476 <listitem> |
621
656dfb085020
Unified server names matching description with server_name directive, improved
Vladimir Homutov <vl@nginx.com>
parents:
618
diff
changeset
|
477 An empty server name “” has been supported since 0.7.12. |
461 | 478 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
479 |
461 | 480 <listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
481 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
|
482 as the first server name since 0.6.25. |
461 | 483 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
484 |
461 | 485 <listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
486 Regular expression server names have been supported since 0.6.7. |
461 | 487 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
488 |
461 | 489 <listitem> |
593
130fad6dc1b4
Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
490 Wildcard form <literal>example.*</literal> has been supported since 0.6.0. |
461 | 491 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
492 |
461 | 493 <listitem> |
593
130fad6dc1b4
Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
494 The special form <literal>.example.org</literal> has been supported since 0.3.18. |
461 | 495 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
496 |
461 | 497 <listitem> |
593
130fad6dc1b4
Replaced the uses of "url" element with "literal".
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
498 Wildcard form <literal>*.example.org</literal> has been supported since 0.1.13. |
461 | 499 </listitem> |
0
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
500 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
501 </list> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
502 </para> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
503 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
504 </section> |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
505 |
61e04fc01027
Initial import of the nginx.org website.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
506 </article> |