You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -974,7 +974,6 @@ TODO
974
974
* cosocket: add configure options for different strategies of handling the cosocket connection exceeding in the pools.
975
975
* review and apply vadim-pavlov's patch for [ngx.location.capture](#ngxlocationcapture)'s `extra_headers` option
976
976
* use `ngx_hash_t` to optimize the built-in header look-up process for [ngx.req.set_header](#ngxreqset_header), [ngx.header.HEADER](#ngxheaderheader), and etc.
977
-
* add directives to run Lua codes when Nginx stops.
978
977
* add `ignore_resp_headers`, `ignore_resp_body`, and `ignore_resp` options to [ngx.location.capture](#ngxlocationcapture) and [ngx.location.capture_multi](#ngxlocationcapture_multi) methods, to allow micro performance tuning on the user side.
979
978
* add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
980
979
* add `stat` mode similar to [mod_lua](https://httpd.apache.org/docs/trunk/mod/mod_lua.html).
Copy file name to clipboardExpand all lines: doc/HttpLuaModule.wiki
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -809,7 +809,6 @@ phases.
809
809
* cosocket: add configure options for different strategies of handling the cosocket connection exceeding in the pools.
810
810
* review and apply vadim-pavlov's patch for [[#ngx.location.capture|ngx.location.capture]]'s <code>extra_headers</code> option
811
811
* use <code>ngx_hash_t</code> to optimize the built-in header look-up process for [[#ngx.req.set_header|ngx.req.set_header]], [[#ngx.header.HEADER|ngx.header.HEADER]], and etc.
812
-
* add directives to run Lua codes when Nginx stops.
813
812
* add <code>ignore_resp_headers</code>, <code>ignore_resp_body</code>, and <code>ignore_resp</code> options to [[#ngx.location.capture|ngx.location.capture]] and [[#ngx.location.capture_multi|ngx.location.capture_multi]] methods, to allow micro performance tuning on the user side.
814
813
* add automatic Lua code time slicing support by yielding and resuming the Lua VM actively via Lua's debug hooks.
815
814
* add <code>stat</code> mode similar to [https://httpd.apache.org/docs/trunk/mod/mod_lua.html mod_lua].
@@ -1607,8 +1606,8 @@ Note that this handler always runs ''after'' the standard [[HttpRewriteModule]].
1607
1606
location /foo {
1608
1607
set $a 12; # create and initialize $a
1609
1608
set $b ""; # create and initialize $b
1610
-
rewrite_by_lua_block {
1611
-
ngx.var.b = tonumber(ngx.var.a) + 1
1609
+
rewrite_by_lua_block {
1610
+
ngx.var.b = tonumber(ngx.var.a) + 1
1612
1611
}
1613
1612
echo "res = $b";
1614
1613
}
@@ -1622,8 +1621,8 @@ On the other hand, the following will not work as expected:
1622
1621
? location /foo {
1623
1622
? set $a 12; # create and initialize $a
1624
1623
? set $b ''; # create and initialize $b
1625
-
? rewrite_by_lua_block {
1626
-
? ngx.var.b = tonumber(ngx.var.a) + 1
1624
+
? rewrite_by_lua_block {
1625
+
? ngx.var.b = tonumber(ngx.var.a) + 1
1627
1626
? }
1628
1627
? if ($b = '13') {
1629
1628
? rewrite ^ /bar redirect;
@@ -1698,8 +1697,8 @@ If the [[HttpRewriteModule]]'s [[HttpRewriteModule#rewrite|rewrite]] directive i
1698
1697
<geshi lang="nginx">
1699
1698
location /foo {
1700
1699
rewrite ^ /bar;
1701
-
rewrite_by_lua_block {
1702
-
ngx.exit(503)
1700
+
rewrite_by_lua_block {
1701
+
ngx.exit(503)
1703
1702
}
1704
1703
}
1705
1704
location /bar {
@@ -1892,8 +1891,8 @@ Here is an example of overriding a response header (or adding one if absent) in
1892
1891
<geshi lang="nginx">
1893
1892
location / {
1894
1893
proxy_pass http://mybackend;
1895
-
header_filter_by_lua_block {
1896
-
ngx.header.Foo = "blah"
1894
+
header_filter_by_lua_block {
1895
+
ngx.header.Foo = "blah"
1897
1896
}
1898
1897
}
1899
1898
</geshi>
@@ -1964,8 +1963,8 @@ The Lua code can pass its own modified version of the input data chunk to the do
1964
1963
<geshi lang="nginx">
1965
1964
location / {
1966
1965
proxy_pass http://mybackend;
1967
-
body_filter_by_lua_block {
1968
-
ngx.arg[1] = string.upper(ngx.arg[1])
1966
+
body_filter_by_lua_block {
1967
+
ngx.arg[1] = string.upper(ngx.arg[1])
1969
1968
}
1970
1969
}
1971
1970
</geshi>
@@ -2006,11 +2005,11 @@ When the Lua code may change the length of the response body, then it is require
2006
2005
location /foo {
2007
2006
# fastcgi_pass/proxy_pass/...
2008
2007
2009
-
header_filter_by_lua_block {
2010
-
ngx.header.content_length = nil
2008
+
header_filter_by_lua_block {
2009
+
ngx.header.content_length = nil
2011
2010
}
2012
-
body_filter_by_lua_block {
2013
-
ngx.arg[1] = string.len(ngx.arg[1]) .. "\n"
2011
+
body_filter_by_lua_block {
2012
+
ngx.arg[1] = string.len(ngx.arg[1]) .. "\n"
2014
2013
}
2015
2014
}
2016
2015
</geshi>
@@ -3688,8 +3687,8 @@ Lua tables can be used for both requests and responses when the number of subreq
3688
3687
table.insert(reqs, { "/memcached" })
3689
3688
3690
3689
-- issue all the requests at once and wait until they all return
0 commit comments