模块 ngx_http_addition_module
| add_before_body add_after_body addition_types 的配置 Directives 示例 |
这ngx_http_addition_modulemodule 是一个过滤器
,这会在响应前后添加文本。
这个模块不是默认构建的,它应该使用--with-http_addition_moduleconfiguration 参数。
示例配置
location / {
add_before_body /before_action;
add_after_body /after_action;
}
Directives
| 语法: |
add_before_body |
|---|---|
| 默认值: | — |
| 上下文: |
http,server,location |
添加处理给定子请求后返回的文本
在响应正文之前。
空字符串 () 作为参数会取消加法
继承自之前的配置级别。""
| 语法: |
add_after_body |
|---|---|
| 默认值: | — |
| 上下文: |
http,server,location |
添加处理给定子请求后返回的文本
在响应正文之后。
空字符串 () 作为参数会取消加法
继承自之前的配置级别。""
| 语法: |
addition_types |
|---|---|
| 默认值: |
addition_types text/html; |
| 上下文: |
http,server,location |
该Directives出现在 0.7.9 版本中。
允许在具有指定 MIME 类型的响应中添加文本,
除了”text/html”.
特殊值 “” 与任何 MIME 类型 (0.8.29) 匹配。*