Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_charset_module.xml @ 3099:9cfda14d0109 default tip
freenginx-1.27.4
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 03 Sep 2024 13:15:18 +0300 |
parents | ddf686b02ceb |
children |
rev | line source |
---|---|
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
7 |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 <module name="Module ngx_http_charset_module" |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 link="/en/docs/http/ngx_http_charset_module.html" |
589 | 12 lang="en" |
3096
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
13 rev="6"> |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 <section id="summary"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 The <literal>ngx_http_charset_module</literal> module adds the specified |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
19 charset to the <header>Content-Type</header> response header field. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
20 In addition, the module can convert data from one charset to another, |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 with some limitations: |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 <list type="bullet"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 <listitem> |
367
f4033b9bc4ec
- Removed unnecessary instances of unbreakable space.
Ruslan Ermilov <ru@nginx.com>
parents:
351
diff
changeset
|
25 conversion is performed one way — from server to client, |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 </listitem> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 <listitem> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 only single-byte charsets can be converted |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 </listitem> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 <listitem> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 or single-byte charsets to/from UTF-8. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 </listitem> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 </list> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 </section> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 <section id="example" name="Example Configuration"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
350
diff
changeset
|
46 include conf/koi-win; |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
350
diff
changeset
|
48 charset windows-1251; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
350
diff
changeset
|
49 source_charset koi8-r; |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 </example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 </section> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 <section id="directives" name="Directives"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 <directive name="charset"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 <syntax><value>charset</value> | <literal>off</literal></syntax> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 <default>off</default> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 <context>http</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 <context>server</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 <context>location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 <context>if in location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 Adds the specified charset to the <header>Content-Type</header> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 response header field. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 If this charset is different from the charset specified |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 in the <link id="source_charset"/> directive, a conversion is performed. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 The parameter <literal>off</literal> cancels the addition of charset |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 to the <header>Content-Type</header> response header field. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
78 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 A charset can be defined with a variable: |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 <example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 charset $charset; |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 </example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 In such a case, all possible values of a variable need to be present |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 in the configuration at least once in the form of the |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
85 <link id="charset_map"/>, <link id="charset"/>, or |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
86 <link id="source_charset"/> directives. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
87 For <literal>utf-8</literal>, <literal>windows-1251</literal>, and |
966 | 88 <literal>koi8-r</literal> charsets, it is sufficient to include the files |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
89 <path>conf/koi-win</path>, <path>conf/koi-utf</path>, and |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
90 <path>conf/win-utf</path> into configuration. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 For other charsets, simply making a fictitious conversion table works, |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
92 for example: |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 <example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 charset_map iso-8859-5 _ { } |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 </example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
96 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
97 |
506
657848837328
Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
98 <para> |
966 | 99 In addition, a charset can be set in the |
506
657848837328
Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
100 <header>X-Accel-Charset</header> response header field. |
966 | 101 This capability can be disabled using the |
1181 | 102 <link doc="ngx_http_proxy_module.xml" id="proxy_ignore_headers"/>, |
103 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_ignore_headers"/>, | |
1194 | 104 <link doc="ngx_http_uwsgi_module.xml" id="uwsgi_ignore_headers"/>, |
2134
4cafd82e5007
Added info about gRPC to various modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
105 <link doc="ngx_http_scgi_module.xml" id="scgi_ignore_headers"/>, |
506
657848837328
Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
106 and |
2134
4cafd82e5007
Added info about gRPC to various modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
107 <link doc="ngx_http_grpc_module.xml" id="grpc_ignore_headers"/> |
506
657848837328
Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
108 directives. |
657848837328
Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
109 </para> |
657848837328
Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
110 |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
111 </directive> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
112 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
113 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
114 <directive name="charset_map"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
115 <syntax block="yes"><value>charset1</value> <value>charset2</value></syntax> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
116 <default/> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
117 <context>http</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
118 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
119 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
120 Describes the conversion table from one charset to another. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
121 A reverse conversion table is built using the same data. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
122 Character codes are given in hexadecimal. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
123 Missing characters in the range 80-FF are replaced with “<literal>?</literal>”. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
124 When converting from UTF-8, characters missing in a one-byte charset |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
125 are replaced with “<literal>&#XXXX;</literal>”. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
126 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
127 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
128 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
129 Example: |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
130 <example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
131 charset_map koi8-r windows-1251 { |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
132 C0 FE ; # small yu |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
133 C1 E0 ; # small a |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
134 C2 E1 ; # small b |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
135 C3 F6 ; # small ts |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
136 ... |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
137 } |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
138 </example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
139 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
140 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
141 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
142 When describing a conversion table to UTF-8, codes for the UTF-8 charset should |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
143 be given in the second column, for example: |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
144 <example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
145 charset_map koi8-r utf-8 { |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
146 C0 D18E ; # small yu |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
147 C1 D0B0 ; # small a |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
148 C2 D0B1 ; # small b |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
149 C3 D186 ; # small ts |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
150 ... |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
151 } |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
152 </example> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
153 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
154 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
155 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
156 Full conversion tables from <literal>koi8-r</literal> to |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
157 <literal>windows-1251</literal>, and from <literal>koi8-r</literal> and |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
158 <literal>windows-1251</literal> to <literal>utf-8</literal> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
159 are provided in the distribution files <path>conf/koi-win</path>, |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
160 <path>conf/koi-utf</path>, and <path>conf/win-utf</path>. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
161 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
162 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
163 </directive> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
164 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
165 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
166 <directive name="charset_types"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
167 <syntax><value>mime-type</value> ...</syntax> |
3096
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
168 <default>text/html text/xml text/javascript text/plain text/markdown |
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
169 text/vnd.wap.wml application/javascript application/rss+xml</default> |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
170 <context>http</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
171 <context>server</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
172 <context>location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
173 <appeared-in>0.7.9</appeared-in> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
174 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
175 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
176 Enables module processing in responses with the specified MIME types |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
177 in addition to “<literal>text/html</literal>”. |
546
694db9597ee0
Documented the special value "*" in various "*_type" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
506
diff
changeset
|
178 The special value “<literal>*</literal>” matches any MIME type (0.8.29). |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
179 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
180 |
952
417dc982362e
Updated default for the "charset_types" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
589
diff
changeset
|
181 <para> |
417dc982362e
Updated default for the "charset_types" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
589
diff
changeset
|
182 <note> |
3096
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
183 Prior to version 1.5.4, “<literal>application/x-javascript</literal>” was used |
952
417dc982362e
Updated default for the "charset_types" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
589
diff
changeset
|
184 as the default MIME type instead of “<literal>application/javascript</literal>”. |
417dc982362e
Updated default for the "charset_types" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
589
diff
changeset
|
185 </note> |
3096
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
186 <note> |
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
187 Prior to version 1.27.4, the default value did not include |
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
188 “<literal>text/javascript</literal>” and “<literal>text/markdown</literal>”. |
ddf686b02ceb
Documented charset_types changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2134
diff
changeset
|
189 </note> |
952
417dc982362e
Updated default for the "charset_types" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
589
diff
changeset
|
190 </para> |
417dc982362e
Updated default for the "charset_types" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
589
diff
changeset
|
191 |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
192 </directive> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
193 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
194 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
195 <directive name="override_charset"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
196 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
197 <default>off</default> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
198 <context>http</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
199 <context>server</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
200 <context>location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
201 <context>if in location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
202 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
203 <para> |
966 | 204 Determines whether a conversion should be performed for answers |
2134
4cafd82e5007
Added info about gRPC to various modules.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
205 received from a proxied or a FastCGI/uwsgi/SCGI/gRPC server |
966 | 206 when the answers already carry a charset in the <header>Content-Type</header> |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
207 response header field. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
208 If conversion is enabled, a charset specified in the received |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
209 response is used as a source charset. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
210 <note> |
966 | 211 It should be noted that if a response is received in a subrequest |
212 then the conversion from the response charset to the main request charset | |
213 is always performed, regardless of the <literal>override_charset</literal> | |
350
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
214 directive setting. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
215 </note> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
216 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
217 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
218 </directive> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
219 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
220 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
221 <directive name="source_charset"> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
222 <syntax><value>charset</value></syntax> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
223 <default/> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
224 <context>http</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
225 <context>server</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
226 <context>location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
227 <context>if in location</context> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
228 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
229 <para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
230 Defines the source charset of a response. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
231 If this charset is different from the charset specified |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
232 in the <link id="charset"/> directive, a conversion is performed. |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
233 </para> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
234 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
235 </directive> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
236 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
237 </section> |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
238 |
55c1c4a1748f
English translation of ngx_http_charset_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
239 </module> |