Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/cn/docs/http/ngx_http_addition_module.xml
1 views
1
<?xml version="1.0"?>
2
3
<!--
4
Copyright (C) Igor Sysoev
5
Copyright (C) Nginx, Inc.
6
-->
7
8
<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9
10
<module name="ngx_http_addition_module模块"
11
link="/cn/docs/http/ngx_http_addition_module.html"
12
lang="cn"
13
translator="Weibin Yao"
14
rev="1">
15
16
<section id="summary">
17
18
<para>
19
<literal>ngx_http_addition_module</literal> 是一个过滤模块,它可以在回复正文前后加上内容。
20
这个模块默认不会编译进去,若要开启需加上编译选项:<literal>--with-http_addition_module</literal>
21
</para>
22
23
</section>
24
25
26
<section id="example" name="配置示例">
27
28
<para>
29
<example>
30
location / {
31
add_before_body /before_action;
32
add_after_body /after_action;
33
}
34
</example>
35
</para>
36
37
</section>
38
39
40
<section id="directives" name="指令">
41
42
<directive name="add_before_body">
43
<syntax><value>uri</value></syntax>
44
<default/>
45
<context>location</context>
46
47
<para>
48
在回复正文之前加入一段文字,nginx会发起一个子请求去获取这些文字。
49
</para>
50
51
</directive>
52
53
54
<directive name="add_after_body">
55
<syntax><value>uri</value></syntax>
56
<default/>
57
<context>location</context>
58
59
<para>
60
在回复正文之后加入一段文字,nginx会发起一个子请求去获取这些文字。
61
</para>
62
63
</directive>
64
65
66
<directive name="addition_types">
67
<syntax><value>mime-type</value> ...</syntax>
68
<default>text/html</default>
69
<context>http</context>
70
<context>server</context>
71
<context>location</context>
72
<appeared-in>0.7.9</appeared-in>
73
74
<para>
75
指定生效的回复MIME类型,默认始终包含“<literal>text/html</literal>”。
76
如果设置类型为“<literal>*</literal>”,就会匹配任何类型的回复(0.8.29)。
77
</para>
78
79
</directive>
80
81
</section>
82
83
</module>
84
85