Path: blob/main/xml/en/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="Module ngx_http_addition_module"10link="/en/docs/http/ngx_http_addition_module.html"11lang="en"12rev="4">1314<section id="summary">1516<para>17The <literal>ngx_http_addition_module</literal> module is a filter18that adds text before and after a response.19This module is not built by default, it should be enabled with the20<literal>--with-http_addition_module</literal>21configuration parameter.22</para>2324</section>252627<section id="example" name="Example Configuration">2829<para>30<example>31location / {32add_before_body /before_action;33add_after_body /after_action;34}35</example>36</para>3738</section>394041<section id="directives" name="Directives">4243<directive name="add_before_body">44<syntax><value>uri</value></syntax>45<default/>46<context>http</context>47<context>server</context>48<context>location</context>4950<para>51Adds the text returned as a result of processing a given subrequest52before the response body.53An empty string (<literal>""</literal>) as a parameter cancels addition54inherited from the previous configuration level.55</para>5657</directive>585960<directive name="add_after_body">61<syntax><value>uri</value></syntax>62<default/>63<context>http</context>64<context>server</context>65<context>location</context>6667<para>68Adds the text returned as a result of processing a given subrequest69after the response body.70An empty string (<literal>""</literal>) as a parameter cancels addition71inherited from the previous configuration level.72</para>7374</directive>757677<directive name="addition_types">78<syntax><value>mime-type</value> ...</syntax>79<default>text/html</default>80<context>http</context>81<context>server</context>82<context>location</context>83<appeared-in>0.7.9</appeared-in>8485<para>86Allows adding text in responses with the specified MIME types,87in addition to “<literal>text/html</literal>”.88The special value “<literal>*</literal>” matches any MIME type (0.8.29).89</para>9091</directive>9293</section>9495</module>969798