Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/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="Module ngx_http_addition_module"
11
link="/en/docs/http/ngx_http_addition_module.html"
12
lang="en"
13
rev="4">
14
15
<section id="summary">
16
17
<para>
18
The <literal>ngx_http_addition_module</literal> module is a filter
19
that adds text before and after a response.
20
This module is not built by default, it should be enabled with the
21
<literal>--with-http_addition_module</literal>
22
configuration parameter.
23
</para>
24
25
</section>
26
27
28
<section id="example" name="Example Configuration">
29
30
<para>
31
<example>
32
location / {
33
add_before_body /before_action;
34
add_after_body /after_action;
35
}
36
</example>
37
</para>
38
39
</section>
40
41
42
<section id="directives" name="Directives">
43
44
<directive name="add_before_body">
45
<syntax><value>uri</value></syntax>
46
<default/>
47
<context>http</context>
48
<context>server</context>
49
<context>location</context>
50
51
<para>
52
Adds the text returned as a result of processing a given subrequest
53
before the response body.
54
An empty string (<literal>""</literal>) as a parameter cancels addition
55
inherited from the previous configuration level.
56
</para>
57
58
</directive>
59
60
61
<directive name="add_after_body">
62
<syntax><value>uri</value></syntax>
63
<default/>
64
<context>http</context>
65
<context>server</context>
66
<context>location</context>
67
68
<para>
69
Adds the text returned as a result of processing a given subrequest
70
after the response body.
71
An empty string (<literal>""</literal>) as a parameter cancels addition
72
inherited from the previous configuration level.
73
</para>
74
75
</directive>
76
77
78
<directive name="addition_types">
79
<syntax><value>mime-type</value> ...</syntax>
80
<default>text/html</default>
81
<context>http</context>
82
<context>server</context>
83
<context>location</context>
84
<appeared-in>0.7.9</appeared-in>
85
86
<para>
87
Allows adding text in responses with the specified MIME types,
88
in addition to “<literal>text/html</literal>”.
89
The special value “<literal>*</literal>” matches any MIME type (0.8.29).
90
</para>
91
92
</directive>
93
94
</section>
95
96
</module>
97
98