documented the body_filter_by_lua_block {} directive.

This commit is contained in:
Yichun Zhang (agentzh) 2015-10-27 11:52:49 +08:00
Родитель d76317b62a
Коммит acc8239910
2 изменённых файлов: 57 добавлений и 0 удалений

Просмотреть файл

@ -1088,6 +1088,7 @@ Directives
* [header_filter_by_lua_block](#header_filter_by_lua_block)
* [header_filter_by_lua_file](#header_filter_by_lua_file)
* [body_filter_by_lua](#body_filter_by_lua)
* [body_filter_by_lua_block](#body_filter_by_lua_block)
* [body_filter_by_lua_file](#body_filter_by_lua_file)
* [log_by_lua](#log_by_lua)
* [log_by_lua_file](#log_by_lua_file)
@ -2034,6 +2035,9 @@ body_filter_by_lua
**phase:** *output-body-filter*
**WARNING** Since the `v0.9.17` release, use of this directive is *discouraged*;
use the new [body_filter_by_lua_block](#body_filter_by_lua_block) directive instead.
Uses Lua code specified in `<lua-script-str>` to define an output body filter.
The input data chunk is passed via [ngx.arg](#ngxarg)\[1\] (as a Lua string value) and the "eof" flag indicating the end of the response body data stream is passed via [ngx.arg](#ngxarg)\[2\] (as a Lua boolean value).
@ -2115,6 +2119,33 @@ This directive was first introduced in the `v0.5.0rc32` release.
[Back to TOC](#directives)
body_filter_by_lua_block
------------------------
**syntax:** *body_filter_by_lua_block { lua-script-str }*
**context:** *http, server, location, location if*
**phase:** *output-body-filter*
Similar to the [body_filter_by_lua](#body_filter_by_lua) directive except that this directive inlines
the Lua source directly
inside a pair of curly braces (`{}`) instead of in an NGINX string literal (which requires
special character escaping).
For instance,
```nginx
body_filter_by_lua_block {
local data, eof = ngx.arg[1], ngx.arg[2]
}
```
This directive was first introduced in the `v0.9.17` release.
[Back to TOC](#directives)
body_filter_by_lua_file
-----------------------

Просмотреть файл

@ -1695,6 +1695,9 @@ This directive was first introduced in the <code>v0.2.1rc20</code> release.
'''phase:''' ''output-body-filter''
'''WARNING''' Since the <code>v0.9.17</code> release, use of this directive is ''discouraged'';
use the new [[#body_filter_by_lua_block|body_filter_by_lua_block]] directive instead.
Uses Lua code specified in <code><lua-script-str></code> to define an output body filter.
The input data chunk is passed via [[#ngx.arg|ngx.arg]][1] (as a Lua string value) and the "eof" flag indicating the end of the response body data stream is passed via [[#ngx.arg|ngx.arg]][2] (as a Lua boolean value).
@ -1770,6 +1773,29 @@ Nginx output filters may be called multiple times for a single request because r
This directive was first introduced in the <code>v0.5.0rc32</code> release.
== body_filter_by_lua_block ==
'''syntax:''' ''body_filter_by_lua_block { lua-script-str }''
'''context:''' ''http, server, location, location if''
'''phase:''' ''output-body-filter''
Similar to the [[#body_filter_by_lua|body_filter_by_lua]] directive except that this directive inlines
the Lua source directly
inside a pair of curly braces (`{}`) instead of in an NGINX string literal (which requires
special character escaping).
For instance,
<geshi lang="nginx">
body_filter_by_lua_block {
local data, eof = ngx.arg[1], ngx.arg[2]
}
</geshi>
This directive was first introduced in the <code>v0.9.17</code> release.
== body_filter_by_lua_file ==
'''syntax:''' ''body_filter_by_lua_file <path-to-lua-script-file>''