On this page
Module ngx_http_addition_module
ngx_http_addition_module
模块是一个过滤器,可在响应前后添加文本。默认情况下未构建此模块,应使用--with-http_addition_module
配置参数启用它。
Example Configuration
location / {
add_before_body /before_action;
add_after_body /after_action;
}
Directives
Syntax: | add_before_body uri; |
Default: | — |
Context: | http , server , location |
在响应正文之前添加由于处理给定的子请求而返回的文本。空字符串(""
)作为参数将取消从先前配置级别继承的添加。
Syntax: | add_after_body uri; |
Default: | — |
Context: | http , server , location |
在响应正文之后添加由于处理给定的子请求而返回的文本。空字符串(""
)作为参数将取消从先前配置级别继承的添加。
Syntax: | addition_types mime-type ...; |
Default: | addition_types text/html; |
Context: | http , server , location |
该指令出现在版本 0.7.9 中。
除“ text/html
”外,还允许在具有指定 MIME 类型的响应中添加文本。特殊值“ *
”匹配任何 MIME 类型(0.8.29)。