Mercurial > hg > nginx-site
annotate xml/ru/docs/http/server_names.xml @ 2919:b2249a72e3de
Updated with Netcraft December 2022 Web Server Survey stats.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Wed, 21 Dec 2022 09:18:04 +0000 |
parents | c56adb7148a4 |
children | 3b5594157fab |
rev | line source |
---|---|
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
1 <!-- |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
2 Copyright (C) Igor Sysoev |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
3 Copyright (C) Nginx, Inc. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
4 --> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
5 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
6 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
7 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
8 <article name="Имена сервера" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
9 link="/ru/docs/http/server_names.html" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
10 lang="ru" |
2767
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
11 rev="4" |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
12 author="Игорь Сысоев" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
13 editor="Brian Mercer"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
14 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
15 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
16 <section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
17 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
18 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
19 Имена сервера задаются с помощью директивы |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
20 <link doc="ngx_http_core_module.xml" id="server_name"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
21 и определяют, в каком блоке <link doc="ngx_http_core_module.xml" id="server"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
22 будет обрабатываться тот или иной запрос. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
23 См. также “<link doc="request_processing.xml"/>”. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
24 Имена могут быть заданы точно, с помощью маски или регулярного |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
25 выражения: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
26 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
27 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
28 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
29 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
30 server_name example.org www.example.org; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
31 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
32 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
33 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
34 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
35 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
36 server_name *.example.org; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
37 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
38 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
39 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
40 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
41 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
42 server_name mail.*; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
43 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
44 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
45 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
46 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
47 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
48 server_name ~^(?<user>.+)\.example\.net$; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
49 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
50 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
51 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
52 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
53 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
54 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
55 При поиске виртуального сервера по имени, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
56 если имени соответствует несколько из указанных вариантов, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
57 например, одновременно подходят и имя с маской, и регулярное выражение, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
58 будет выбран первый подходящий вариант в следующем порядке приоритета: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
59 <list type="enum"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
60 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
61 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
62 точное имя |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
63 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
64 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
65 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
66 самое длинное имя с маской в начале, например |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
67 “<literal>*.example.org</literal>” |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
68 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
69 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
70 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
71 самое длинное имя с маской в конце, например “<literal>mail.*</literal>” |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
72 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
73 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
74 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
75 первое подходящее регулярное выражение |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
76 (в порядке следования в конфигурационном файле) |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
77 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
78 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
79 </list> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
80 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
81 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
82 </section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
83 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
84 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
85 <section id="wildcard_names" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
86 name="Имена с масками"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
87 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
88 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
89 Имя с маской может содержать звёздочку (“<literal>*</literal>”) только в начале |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
90 или в конце имени, и только на границе, определяемой точкой. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
91 Имена “<literal>www.*.example.org</literal>” и |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
92 “<literal>w*.example.org</literal>” являются некорректными, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
93 но их можно задать с помощью регулярных выражений, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
94 например, “<literal>~^www\..+\.example\.org$</literal>” и |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
95 “<literal>~^w.*\.example\.org$</literal>”. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
96 Звёздочка может соответствовать нескольким частям имени. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
97 Имени с маской “<literal>*.example.org</literal>” соответствует не только |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
98 <literal>www.example.org</literal>, но и |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
99 <literal>www.sub.example.org</literal>. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
100 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
101 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
102 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
103 Специальное имя с маской вида “<literal>.example.org</literal>” |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
104 соответствует как точному имени “<literal>example.org</literal>”, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
105 так и маске “<literal>*.example.org</literal>”. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
106 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
107 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
108 </section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
109 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
110 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
111 <section id="regex_names" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
112 name="Имена, заданные регулярными выражениями"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
113 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
114 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
115 Регулярные выражения, используемые в nginx, совместимы |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
116 с используемыми в языке программирования Perl (PCRE). |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
117 Имя сервера, заданное регулярным выражением, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
118 должно начинаться с символа тильды: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
119 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
120 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
121 server_name ~^www\d+\.example\.net$; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
122 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
123 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
124 в противном случае оно будет рассматриваться как точное, или же, если |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
125 выражение содержит звёздочку (“<literal>*</literal>”), то как имя с маской |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
126 (и, скорее всего, некорректное). |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
127 Не забывайте ставить специальные символы начала (“<literal>^</literal>”) |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
128 и конца (“<literal>$</literal>”) строки. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
129 По синтаксису они не требуются, но логически они могут быть нужны. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
130 Также заметьте, что все точки в доменных именах должны быть экранированы |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
131 символом обратной косой черты. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
132 Регулярное выражение, содержащее символы “<literal>{</literal>” |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
133 и “<literal>}</literal>”, необходимо экранировать: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
134 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
135 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
136 server_name "~^(?<name>\w\d<b>{</b>1,3<b>}</b>+)\.example\.net$"; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
137 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
138 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
139 иначе nginx откажется запускаться и выдаст сообщение об ошибке: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
140 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
141 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
142 directive "server_name" is not terminated by ";" in ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
143 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
144 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
145 К именованному выделению в регулярном выражении можно впоследствии |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
146 обратиться через переменную: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
147 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
148 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
149 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
150 server_name ~^(www\.)?(<b>?<domain></b>.+)$; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
151 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
152 location / { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
153 root /sites/<b>$domain</b>; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
154 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
155 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
156 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
157 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
158 Библиотека PCRE поддерживает именованные выделения, используя следующий |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
159 синтаксис: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
160 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
161 <table note="yes"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
162 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
163 <tr> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
164 <td><literal>?<<value>name</value>></literal></td> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
165 <td>Совместимый с Perl 5.10 синтаксис, поддерживается начиная с PCRE-7.0</td> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
166 </tr> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
167 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
168 <tr> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
169 <td><literal>?'<value>name</value>'</literal></td> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
170 <td>Совместимый с Perl 5.10 синтаксис, поддерживается начиная с PCRE-7.0</td> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
171 </tr> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
172 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
173 <tr> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
174 <td><literal>?P<<value>name</value>></literal></td> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
175 <td>Python-совместимый синтаксис, поддерживается начиная с PCRE-4.0</td> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
176 </tr> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
177 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
178 </table> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
179 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
180 Если nginx отказывается запускаться и выдаёт сообщение об ошибке: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
181 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
182 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
183 pcre_compile() failed: unrecognized character after (?< in ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
184 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
185 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
186 то это значит, что используется старая версия библиотеки PCRE и следует |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
187 вместо этого попробовать синтаксис |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
188 “<literal>?P<<value>name</value>></literal>”. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
189 Также можно использовать нумерованные выделения: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
190 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
191 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
192 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
193 server_name ~^(www\.)?(.+)$; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
194 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
195 location / { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
196 root /sites/<b>$2</b>; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
197 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
198 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
199 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
200 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
201 Однако такое использование должно ограничиваться простыми случаями как в |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
202 примере выше, поскольку нумерованные выделения легко могут быть перезаписаны. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
203 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
204 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
205 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
206 </section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
207 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
208 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
209 <section id="miscellaneous_names" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
210 name="Прочие имена"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
211 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
212 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
213 Некоторые имена имеют специальное значение. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
214 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
215 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
216 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
217 Если необходимо обрабатывать запросы без поля <header>Host</header> в заголовке |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
218 в блоке <link doc="ngx_http_core_module.xml" id="server"/>, который не |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
219 является сервером по умолчанию, следует указать пустое имя: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
220 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
221 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
222 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
223 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
224 server_name example.org www.example.org ""; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
225 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
226 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
227 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
228 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
229 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
230 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
231 Если директива |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
232 <link doc="ngx_http_core_module.xml" id="server_name"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
233 не задана в блоке <link doc="ngx_http_core_module.xml" id="server"/>, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
234 то nginx будет использовать пустое имя в качестве имени сервера. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
235 <note> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
236 Версии nginx вплоть до 0.8.48 в этом случае использовали имя хоста (hostname) |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
237 машины в качестве имени сервера. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
238 </note> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
239 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
240 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
241 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
242 Если имя сервера задано как “<literal>$hostname</literal>” (0.9.4), то |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
243 используется имя хоста (hostname) машины. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
244 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
245 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
246 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
247 Если в запросе вместо имени сервера указан IP-адрес, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
248 то поле <header>Host</header> заголовка запроса будет содержать |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
249 IP-адрес, и запрос можно обработать, используя IP-адрес как имя сервера: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
250 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
251 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
252 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
253 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
254 server_name example.org |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
255 www.example.org |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
256 "" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
257 <b>192.168.1.1</b> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
258 ; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
259 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
260 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
261 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
262 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
263 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
264 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
265 В примерах конфигурации серверов, обрабатывающих все запросы, встречается |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
266 странное имя “<literal>_</literal>”: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
267 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
268 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
269 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
270 listen 80 default_server; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
271 server_name _; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
272 return 444; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
273 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
274 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
275 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
276 Оно не является каким-то особенным, это просто одно из множества |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
277 некорректных доменных имён, которые никогда не пересекутся ни с одним из |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
278 реальных имён. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
279 С тем же успехом можно использовать имена типа “<literal>--</literal>” |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
280 и “<literal>!@#</literal>”. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
281 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
282 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
283 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
284 Версии nginx вплоть до 0.6.25 поддерживали специальное имя |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
285 “<literal>*</literal>”, которое многими неверно воспринималось как |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
286 имя сервера для обработки всех запросов. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
287 Оно никогда так не работало, и не работало как имя с маской. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
288 Это имя действовало так же, как сейчас действует директива |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
289 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/>. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
290 Специальное имя “<literal>*</literal>” объявлено устаревшим, а вместо него |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
291 следует использовать директиву |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
292 <link doc="ngx_http_core_module.xml" id="server_name_in_redirect"/>. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
293 Заметьте, что с помощью директивы |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
294 <link doc="ngx_http_core_module.xml" id="server_name"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
295 нельзя задать ни имя сервера для обработки всех запросов, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
296 ни сервер по умолчанию. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
297 Это является свойством директивы |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
298 <link doc="ngx_http_core_module.xml" id="listen"/>, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
299 а не |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
300 <link doc="ngx_http_core_module.xml" id="server_name"/>. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
301 См. также “<link doc="request_processing.xml"/>”. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
302 Можно настроить серверы, слушающие на портах *:80 и *:8080, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
303 и указать, что один из них будет сервером по умолчанию для порта *:8080, |
647
00972444baa7
Fixed tab indentation and replaced hyphen with proper space and dash.
Vladimir Homutov <vl@nginx.com>
parents:
645
diff
changeset
|
304 а другой — для порта *:80: |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
305 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
306 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
307 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
308 listen 8080 default_server; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
309 server_name example.net; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
310 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
311 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
312 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
313 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
314 listen 80 default_server; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
315 listen 8080; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
316 server_name example.org; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
317 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
318 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
319 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
320 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
321 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
322 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
323 </section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
324 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
325 |
2042
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
326 <section id="idn" |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
327 name="Интернационализованные имена"> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
328 <para> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
329 Для указания интернационализированных доменных имён |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
330 (<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:
659
diff
changeset
|
331 в директиве <link doc="ngx_http_core_module.xml" id="server_name"/> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
332 следует указывать Punycode-представление имени: |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
333 <programlisting> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
334 server { |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
335 listen 80; |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
336 server_name xn--e1afmkfd.xn--80akhbyknj4f; # пример.испытание |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
337 ... |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
338 } |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
339 </programlisting> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
340 </para> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
341 |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
342 </section> |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
343 |
30e2bd353998
Added info about Punycode to "Server Names".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
659
diff
changeset
|
344 |
2767
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
345 <section id="virtual_server_selection" |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
346 name="Выбор виртуального сервера"> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
347 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
348 <para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
349 Сначала соединение создаётся в контесте сервера по умолчанию. |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
350 Затем имя сервера может быть определено |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
351 на следующих стадиях обработки запроса, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
352 каждая из которых участвует в выборе конфигурации: |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
353 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
354 <list type="bullet"> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
355 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
356 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
357 <para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
358 предварительно во время операции SSL handshake согласно |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
359 <link doc="configuring_https_servers.xml" id="sni">SNI</link> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
360 </para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
361 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
362 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
363 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
364 <para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
365 после обработки строки запроса |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
366 </para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
367 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
368 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
369 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
370 <para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
371 после обработки поля <literal>Host</literal> заголовка запроса |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
372 </para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
373 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
374 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
375 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
376 <para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
377 если после обработки строки запроса или |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
378 поля <literal>Host</literal> заголовка запроса имя сервера не было выбрано, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
379 то nginx будет использовать пустое имя в качестве имени сервера. |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
380 </para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
381 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
382 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
383 </list> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
384 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
385 На каждой из этих стадий могут применяться различные конфигурации сервера. |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
386 Таким образом, некоторые директивы следует указывать с осторожностью: |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
387 <list type="bullet"> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
388 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
389 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
390 в случае использования |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
391 директивы <link doc="ngx_http_ssl_module.xml" id="ssl_protocols"/> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
392 список протоколов задаётся библиотекой OpenSSL |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
393 перед применением конфигурации сервера согласно имени, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
394 запрашиваемого через SNI. |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
395 Таким образом, протоколы должны быть заданы только для сервера по умолчанию; |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
396 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
397 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
398 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
399 директивы |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
400 <link doc="ngx_http_core_module.xml" id="client_header_buffer_size"/> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
401 и |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
402 <link doc="ngx_http_core_module.xml" id="merge_slashes"/> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
403 задействуются перед чтением строки запроса, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
404 таким образом они используют конфигурацию сервера по умолчанию или |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
405 конфигурацию сервера, выбранного через SNI; |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
406 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
407 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
408 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
409 в случае использования директив |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
410 <link doc="ngx_http_core_module.xml" id="ignore_invalid_headers"/>, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
411 <link doc="ngx_http_core_module.xml" id="large_client_header_buffers"/> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
412 и |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
413 <link doc="ngx_http_core_module.xml" id="underscores_in_headers"/>, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
414 которые участвуют в обработке полей заголовка запроса, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
415 выбор сервера дополнительно зависит от того, |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
416 была ли обновлена конфигурация сервера |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
417 согласно строке запроса или полю заголовка <literal>Host</literal>; |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
418 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
419 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
420 <listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
421 ошибочный ответ будет обработан с помощью |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
422 директивы <link doc="ngx_http_core_module.xml" id="error_page"/> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
423 в том сервере, который в настоящий момент выполняет запрос. |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
424 </listitem> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
425 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
426 </list> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
427 </para> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
428 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
429 </section> |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
430 |
c56adb7148a4
Described more details about server selection.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2042
diff
changeset
|
431 |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
432 <section id="optimization" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
433 name="Оптимизация"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
434 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
435 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
436 Точные имена, имена с масками, начинающиеся со звёздочки, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
437 и имена с масками, заканчивающиеся на звёздочку, хранятся |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
438 в трёх хэш-таблицах, привязанных к слушающим портам. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
439 Размеры хэш-таблиц оптимизируются на фазе конфигурации таким образом, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
440 что имя может быть найдено с минимальным числом непопаданий в кэш процессора. |
659
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
647
diff
changeset
|
441 Подробнее настройка хэш-таблиц обсуждается в отдельном |
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
647
diff
changeset
|
442 <link doc="../hash.xml">документе</link>. |
645
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
443 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
444 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
445 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
446 В первую очередь имя ищется в хэш-таблице точных имён. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
447 Если имя не было найдено, то имя ищется в хэш-таблице имён с масками, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
448 начинающихся со звёздочки. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
449 Если и там поиск не дал результата, то имя ищется в хэш-таблице имён с масками, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
450 оканчивающихся на звёздочку. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
451 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
452 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
453 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
454 Поиск в хэш-таблице имён с масками медленнее, чем поиск в хэш-таблице точных |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
455 имён, поскольку имена сравниваются по доменным частям. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
456 Заметьте, что специальное имя с маской вида “<literal>.example.org</literal>” |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
457 хранится в хэш-таблице имён с масками, а не в хэш-таблице точных имён. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
458 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
459 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
460 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
461 Регулярные выражения проверяются последовательно, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
462 а значит являются самым медленным и плохо масштабируемым методом. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
463 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
464 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
465 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
466 По вышеизложенным причинам предпочтительнее использовать точные имена, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
467 где это только возможно. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
468 Например, если к серверу наиболее часто обращаются по именам |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
469 <literal>example.org</literal> и <literal>www.example.org</literal>, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
470 то эффективнее будет указать их явно: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
471 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
472 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
473 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
474 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
475 server_name example.org www.example.org *.example.org; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
476 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
477 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
478 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
479 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
480 нежели чем использовать упрощённую форму: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
481 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
482 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
483 server { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
484 listen 80; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
485 server_name .example.org; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
486 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
487 } |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
488 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
489 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
490 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
491 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
492 Если задано большое число имён серверов, либо заданы необычно |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
493 длинные имена, возможно потребуется скорректировать значения директив |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
494 <link doc="ngx_http_core_module.xml" id="server_names_hash_max_size"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
495 и <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
496 на уровне <i>http</i>. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
497 Значение по умолчанию директивы |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
498 <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
499 может быть равно 32, 64, либо другой величине, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
500 в зависимости от размера строки кэша процессора. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
501 Если значение по умолчанию равно 32 и имя сервера задано как |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
502 “<literal>too.long.server.name.example.org</literal>”, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
503 то nginx откажется запускаться и выдаст сообщение об ошибке: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
504 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
505 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
506 could not build the server_names_hash, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
507 you should increase server_names_hash_bucket_size: 32 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
508 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
509 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
510 В этом случае следует увеличить значение директивы до следующей степени двойки: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
511 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
512 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
513 http { |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
514 server_names_hash_bucket_size 64; |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
515 ... |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
516 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
517 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
518 Если задано большое число имён серверов, то будет выдано другое |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
519 сообщение об ошибке: |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
520 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
521 <programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
522 could not build the server_names_hash, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
523 you should increase either server_names_hash_max_size: 512 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
524 or server_names_hash_bucket_size: 32 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
525 </programlisting> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
526 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
527 В таком случае сначала следует попробовать установить |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
528 <link doc="ngx_http_core_module.xml" id="server_names_hash_max_size"/> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
529 в величину, близкую к числу имён серверов, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
530 и только если это не поможет |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
531 или время запуска nginx станет неприемлемо большим, следует попытаться увеличить |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
532 <link doc="ngx_http_core_module.xml" id="server_names_hash_bucket_size"/>. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
533 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
534 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
535 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
536 Если сервер является единственным сервером для слушающего порта, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
537 то nginx не будет проверять имена сервера вообще (а также не будет |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
538 строить хэш-таблицы для слушающего порта). |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
539 За одним исключением: если имя сервера задано регулярным выражением |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
540 с выделениями, то nginx’у придётся выполнить это выражение, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
541 чтобы получить значения выделений. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
542 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
543 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
544 </section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
545 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
546 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
547 <section id="compatibility" |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
548 name="Совместимость"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
549 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
550 <para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
551 <list type="bullet"> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
552 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
553 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
554 Специальное имя сервера “<literal>$hostname</literal>” поддерживается начиная с |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
555 версии 0.9.4. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
556 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
557 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
558 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
559 Имя сервера по умолчанию является пустой строкой “” начиная с версии 0.8.48. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
560 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
561 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
562 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
563 Именованные выделения в именах серверов, заданных с помощью регулярных |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
564 выражений, поддерживаются начиная с версии 0.8.25. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
565 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
566 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
567 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
568 Выделения в именах серверов, заданных с помощью регулярных выражений, |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
569 поддерживаются начиная с версии 0.7.40. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
570 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
571 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
572 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
573 Пустое имя сервера “” поддерживается начиная с версии 0.7.12. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
574 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
575 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
576 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
577 В качестве первого имени сервера можно задать маску или регулярное выражение |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
578 начиная с версии 0.6.25. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
579 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
580 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
581 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
582 Регулярные выражения в имени сервера поддерживаются начиная с версии 0.6.7. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
583 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
584 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
585 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
586 Имена с маской вида <literal>example.*</literal> поддерживаются начиная |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
587 с версии 0.6.0. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
588 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
589 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
590 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
591 Специальная форма имени вида <literal>.example.org</literal> поддерживается |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
592 начиная с версии 0.3.18. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
593 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
594 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
595 <listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
596 Имена с маской вида <literal>*.example.org</literal> поддерживаются начиная |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
597 с версии 0.1.13. |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
598 </listitem> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
599 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
600 </list> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
601 </para> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
602 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
603 </section> |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
604 |
bb450e295ca2
Translated "Server names" into Russian and slightly changed original layout.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
605 </article> |