Mercurial > hg > nginx
annotate conf/win-utf @ 8122:106328a70f4e
Added warning about redefinition of listen socket protocol options.
The "listen" directive in the http module can be used multiple times
in different server blocks. Originally, it was supposed to be specified
once with various socket options, and without any parameters in virtual
server blocks. For example:
server { listen 80 backlog=1024; server_name foo; ... }
server { listen 80; server_name bar; ... }
server { listen 80; server_name bazz; ... }
The address part of the syntax ("address[:port]" / "port" / "unix:path")
uniquely identifies the listening socket, and therefore is enough for
name-based virtual servers (to let nginx know that the virtual server
accepts requests on the listening socket in question).
To ensure that listening options do not conflict between virtual servers,
they were allowed only once. For example, the following configuration
will be rejected ("duplicate listen options for 0.0.0.0:80 in ..."):
server { listen 80 backlog=1024; server_name foo; ... }
server { listen 80 backlog=512; server_name bar; ... }
At some point it was, however, noticed, that it is sometimes convenient
to repeat some options for clarity. In nginx 0.8.51 the "ssl" parameter
was allowed to be specified multiple times, e.g.:
server { listen 443 ssl backlog=1024; server_name foo; ... }
server { listen 443 ssl; server_name bar; ... }
server { listen 443 ssl; server_name bazz; ... }
This approach makes configuration more readable, since SSL sockets are
immediately visible in the configuration. If this is not needed, just the
address can still be used.
Later, additional protocol-specific options similar to "ssl" were
introduced, notably "http2" and "proxy_protocol". With these options,
one can write:
server { listen 443 ssl backlog=1024; server_name foo; ... }
server { listen 443 http2; server_name bar; ... }
server { listen 443 proxy_protocol; server_name bazz; ... }
The resulting socket will use ssl, http2, and proxy_protocol, but this
is not really obvious from the configuration.
To emphasize such misleading configurations are discouraged, nginx now
warns as long as the "listen" directive is used with options different
from the options previously used if this is potentially confusing.
In particular, the following configurations are allowed:
server { listen 8401 ssl backlog=1024; server_name foo; }
server { listen 8401 ssl; server_name bar; }
server { listen 8401 ssl; server_name bazz; }
server { listen 8402 ssl http2 backlog=1024; server_name foo; }
server { listen 8402 ssl; server_name bar; }
server { listen 8402 ssl; server_name bazz; }
server { listen 8403 ssl; server_name bar; }
server { listen 8403 ssl; server_name bazz; }
server { listen 8403 ssl http2; server_name foo; }
server { listen 8404 ssl http2 backlog=1024; server_name foo; }
server { listen 8404 http2; server_name bar; }
server { listen 8404 http2; server_name bazz; }
server { listen 8405 ssl http2 backlog=1024; server_name foo; }
server { listen 8405 ssl http2; server_name bar; }
server { listen 8405 ssl http2; server_name bazz; }
server { listen 8406 ssl; server_name foo; }
server { listen 8406; server_name bar; }
server { listen 8406; server_name bazz; }
And the following configurations will generate warnings:
server { listen 8501 ssl http2 backlog=1024; server_name foo; }
server { listen 8501 http2; server_name bar; }
server { listen 8501 ssl; server_name bazz; }
server { listen 8502 backlog=1024; server_name foo; }
server { listen 8502 ssl; server_name bar; }
server { listen 8503 ssl; server_name foo; }
server { listen 8503 http2; server_name bar; }
server { listen 8504 ssl; server_name foo; }
server { listen 8504 http2; server_name bar; }
server { listen 8504 proxy_protocol; server_name bazz; }
server { listen 8505 ssl http2 proxy_protocol; server_name foo; }
server { listen 8505 ssl http2; server_name bar; }
server { listen 8505 ssl; server_name bazz; }
server { listen 8506 ssl http2; server_name foo; }
server { listen 8506 ssl; server_name bar; }
server { listen 8506; server_name bazz; }
server { listen 8507 ssl; server_name bar; }
server { listen 8507; server_name bazz; }
server { listen 8507 ssl http2; server_name foo; }
server { listen 8508 ssl; server_name bar; }
server { listen 8508; server_name bazz; }
server { listen 8508 ssl backlog=1024; server_name foo; }
server { listen 8509; server_name bazz; }
server { listen 8509 ssl; server_name bar; }
server { listen 8509 ssl backlog=1024; server_name foo; }
The basic idea is that at most two sets of protocol options are allowed:
the main one (with socket options, if any), and a shorter one, with options
being a subset of the main options, repeated for clarity. As long as the
shorter set of protocol options is used, all listen directives except the
main one should use it.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 28 Jan 2023 01:29:45 +0300 |
parents | 63a820b0bc6c |
children |
rev | line source |
---|---|
667 | 1 |
2 # This map is not a full windows-1251 <> utf8 map: it does not | |
3 # contain Serbian and Macedonian letters. If you need a full map, | |
4 # use contrib/unicode2nginx/win-utf map instead. | |
657 | 5 |
6 charset_map windows-1251 utf-8 { | |
7 | |
8 82 E2809A ; # single low-9 quotation mark | |
9 | |
10 84 E2809E ; # double low-9 quotation mark | |
11 85 E280A6 ; # ellipsis | |
12 86 E280A0 ; # dagger | |
13 87 E280A1 ; # double dagger | |
14 88 E282AC ; # euro | |
15 89 E280B0 ; # per mille | |
16 | |
17 91 E28098 ; # left single quotation mark | |
18 92 E28099 ; # right single quotation mark | |
19 93 E2809C ; # left double quotation mark | |
20 94 E2809D ; # right double quotation mark | |
21 95 E280A2 ; # bullet | |
22 96 E28093 ; # en dash | |
23 97 E28094 ; # em dash | |
24 | |
25 99 E284A2 ; # trade mark sign | |
26 | |
27 A0 C2A0 ; # | |
28 A1 D18E ; # capital Byelorussian short U | |
29 A2 D19E ; # small Byelorussian short u | |
30 | |
31 A4 C2A4 ; # currency sign | |
32 A5 D290 ; # capital Ukrainian soft G | |
33 A6 C2A6 ; # borken bar | |
34 A7 C2A7 ; # section sign | |
35 A8 D081 ; # capital YO | |
36 A9 C2A9 ; # (C) | |
37 AA D084 ; # capital Ukrainian YE | |
38 AB C2AB ; # left-pointing double angle quotation mark | |
39 AC C2AC ; # not sign | |
40 AD C2AD ; # soft hypen | |
41 AE C2AE ; # (R) | |
42 AF D087 ; # capital Ukrainian YI | |
43 | |
44 B0 C2B0 ; # ° | |
45 B1 C2B1 ; # plus-minus sign | |
46 B2 D086 ; # capital Ukrainian I | |
47 B3 D196 ; # small Ukrainian i | |
48 B4 D291 ; # small Ukrainian soft g | |
49 B5 C2B5 ; # micro sign | |
50 B6 C2B6 ; # pilcrow sign | |
51 B7 C2B7 ; # · | |
52 B8 D191 ; # small yo | |
53 B9 E28496 ; # numero sign | |
54 BA D194 ; # small Ukrainian ye | |
55 BB C2BB ; # right-pointing double angle quotation mark | |
56 | |
57 BF D197 ; # small Ukrainian yi | |
58 | |
59 C0 D090 ; # capital A | |
60 C1 D091 ; # capital B | |
61 C2 D092 ; # capital V | |
62 C3 D093 ; # capital G | |
63 C4 D094 ; # capital D | |
64 C5 D095 ; # capital YE | |
65 C6 D096 ; # capital ZH | |
66 C7 D097 ; # capital Z | |
67 C8 D098 ; # capital I | |
68 C9 D099 ; # capital J | |
69 CA D09A ; # capital K | |
70 CB D09B ; # capital L | |
71 CC D09C ; # capital M | |
72 CD D09D ; # capital N | |
73 CE D09E ; # capital O | |
74 CF D09F ; # capital P | |
75 | |
76 D0 D0A0 ; # capital R | |
77 D1 D0A1 ; # capital S | |
78 D2 D0A2 ; # capital T | |
79 D3 D0A3 ; # capital U | |
80 D4 D0A4 ; # capital F | |
81 D5 D0A5 ; # capital KH | |
82 D6 D0A6 ; # capital TS | |
83 D7 D0A7 ; # capital CH | |
84 D8 D0A8 ; # capital SH | |
85 D9 D0A9 ; # capital SHCH | |
86 DA D0AA ; # capital hard sign | |
87 DB D0AB ; # capital Y | |
88 DC D0AC ; # capital soft sign | |
89 DD D0AD ; # capital E | |
90 DE D0AE ; # capital YU | |
91 DF D0AF ; # capital YA | |
92 | |
93 E0 D0B0 ; # small a | |
94 E1 D0B1 ; # small b | |
95 E2 D0B2 ; # small v | |
96 E3 D0B3 ; # small g | |
97 E4 D0B4 ; # small d | |
98 E5 D0B5 ; # small ye | |
99 E6 D0B6 ; # small zh | |
100 E7 D0B7 ; # small z | |
101 E8 D0B8 ; # small i | |
102 E9 D0B9 ; # small j | |
103 EA D0BA ; # small k | |
104 EB D0BB ; # small l | |
105 EC D0BC ; # small m | |
106 ED D0BD ; # small n | |
107 EE D0BE ; # small o | |
108 EF D0BF ; # small p | |
109 | |
110 F0 D180 ; # small r | |
111 F1 D181 ; # small s | |
112 F2 D182 ; # small t | |
113 F3 D183 ; # small u | |
114 F4 D184 ; # small f | |
115 F5 D185 ; # small kh | |
116 F6 D186 ; # small ts | |
117 F7 D187 ; # small ch | |
118 F8 D188 ; # small sh | |
119 F9 D189 ; # small shch | |
120 FA D18A ; # small hard sign | |
121 FB D18B ; # small y | |
122 FC D18C ; # small soft sign | |
123 FD D18D ; # small e | |
124 FE D18E ; # small yu | |
125 FF D18F ; # small ya | |
126 } |