Path: blob/main/xml/cn/docs/http/ngx_http_addition_module.xml
1 views
<?xml version="1.0"?>12<!--3Copyright (C) Igor Sysoev4Copyright (C) Nginx, Inc.5-->67<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">89<module name="ngx_http_addition_module模块"10link="/cn/docs/http/ngx_http_addition_module.html"11lang="cn"12translator="Weibin Yao"13rev="1">1415<section id="summary">1617<para>18<literal>ngx_http_addition_module</literal> 是一个过滤模块,它可以在回复正文前后加上内容。19这个模块默认不会编译进去,若要开启需加上编译选项:<literal>--with-http_addition_module</literal>。20</para>2122</section>232425<section id="example" name="配置示例">2627<para>28<example>29location / {30add_before_body /before_action;31add_after_body /after_action;32}33</example>34</para>3536</section>373839<section id="directives" name="指令">4041<directive name="add_before_body">42<syntax><value>uri</value></syntax>43<default/>44<context>location</context>4546<para>47在回复正文之前加入一段文字,nginx会发起一个子请求去获取这些文字。48</para>4950</directive>515253<directive name="add_after_body">54<syntax><value>uri</value></syntax>55<default/>56<context>location</context>5758<para>59在回复正文之后加入一段文字,nginx会发起一个子请求去获取这些文字。60</para>6162</directive>636465<directive name="addition_types">66<syntax><value>mime-type</value> ...</syntax>67<default>text/html</default>68<context>http</context>69<context>server</context>70<context>location</context>71<appeared-in>0.7.9</appeared-in>7273<para>74指定生效的回复MIME类型,默认始终包含“<literal>text/html</literal>”。75如果设置类型为“<literal>*</literal>”,就会匹配任何类型的回复(0.8.29)。76</para>7778</directive>7980</section>8182</module>838485