ported all the documentation tweaks from the nginx wiki site.
This commit is contained in:
Родитель
a9d1383bd9
Коммит
9ad04360ce
17
README
17
README
|
@ -250,9 +250,9 @@ Directives
|
|||
request (such that Lua modules will not be cached either). With this in
|
||||
place, developers can adopt an edit-and-refresh approach.
|
||||
|
||||
Please note however, that Lua code written inline within nginx.conf such
|
||||
as those specified by set_by_lua, content_by_lua, access_by_lua, and
|
||||
rewrite_by_lua will *always* be cached because only the Nginx config
|
||||
Please note however, that Lua code written inlined within nginx.conf
|
||||
such as those specified by set_by_lua, content_by_lua, access_by_lua,
|
||||
and rewrite_by_lua will *always* be cached because only the Nginx config
|
||||
file parser can correctly parse the "nginx.conf" file and the only ways
|
||||
to to reload the config file are to send a "HUP" signal or to restart
|
||||
Nginx.
|
||||
|
@ -3891,6 +3891,9 @@ Nginx API for Lua
|
|||
|
||||
This feature was first introduced in the "v0.3.1rc22" release.
|
||||
|
||||
Please note that while internally the key-value pair is set atomically,
|
||||
the atomicity does not go across the method call boundary.
|
||||
|
||||
See also ngx.shared.DICT.
|
||||
|
||||
ngx.shared.DICT.add
|
||||
|
@ -4570,9 +4573,9 @@ Nginx API for Lua
|
|||
|
||||
context: *rewrite_by_lua*, access_by_lua*, content_by_lua**
|
||||
|
||||
Puts the current socket's connection into the cosocket built-in
|
||||
connection pool and keep it alive until other connect method calls
|
||||
request it or the associated maximal idle timeout is expired.
|
||||
Puts the current socket's connection immediately into the cosocket
|
||||
built-in connection pool and keep it alive until other connect method
|
||||
calls request it or the associated maximal idle timeout is expired.
|
||||
|
||||
The first optional argument, "timeout", can be used to specify the
|
||||
maximal idle timeout (in milliseconds) for the current connection. If
|
||||
|
@ -5218,7 +5221,7 @@ Data Sharing within an Nginx Worker
|
|||
and then accessing it from "nginx.conf":
|
||||
|
||||
location /lua {
|
||||
content_lua_by_lua '
|
||||
content_by_lua '
|
||||
local mydata = require "mydata"
|
||||
ngx.say(mydata.get_age("dog"))
|
||||
';
|
||||
|
|
|
@ -240,7 +240,7 @@ and the Lua `package.loaded` table will be cleared
|
|||
at the entry point of every request (such that Lua modules
|
||||
will not be cached either). With this in place, developers can adopt an edit-and-refresh approach.
|
||||
|
||||
Please note however, that Lua code written inline within nginx.conf
|
||||
Please note however, that Lua code written inlined within nginx.conf
|
||||
such as those specified by [set_by_lua](http://wiki.nginx.org/HttpLuaModule#set_by_lua), [content_by_lua](http://wiki.nginx.org/HttpLuaModule#content_by_lua),
|
||||
[access_by_lua](http://wiki.nginx.org/HttpLuaModule#access_by_lua), and [rewrite_by_lua](http://wiki.nginx.org/HttpLuaModule#rewrite_by_lua) will *always* be
|
||||
cached because only the Nginx config file parser can correctly parse the `nginx.conf`
|
||||
|
@ -3560,6 +3560,8 @@ These two forms are fundamentally equivalent.
|
|||
|
||||
This feature was first introduced in the `v0.3.1rc22` release.
|
||||
|
||||
Please note that while internally the key-value pair is set atomically, the atomicity does not go across the method call boundary.
|
||||
|
||||
See also [ngx.shared.DICT](http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT).
|
||||
|
||||
ngx.shared.DICT.add
|
||||
|
@ -4104,7 +4106,7 @@ tcpsock:setkeepalive
|
|||
|
||||
**context:** *rewrite_by_lua*, access_by_lua*, content_by_lua**
|
||||
|
||||
Puts the current socket's connection into the cosocket built-in connection pool and keep it alive until other [connect](http://wiki.nginx.org/HttpLuaModule#tcpsock:connect) method calls request it or the associated maximal idle timeout is expired.
|
||||
Puts the current socket's connection immediately into the cosocket built-in connection pool and keep it alive until other [connect](http://wiki.nginx.org/HttpLuaModule#tcpsock:connect) method calls request it or the associated maximal idle timeout is expired.
|
||||
|
||||
The first optional argument, `timeout`, can be used to specify the maximal idle timeout (in milliseconds) for the current connection. If omitted, the default setting in the [lua_socket_keepalive_timeout](http://wiki.nginx.org/HttpLuaModule#lua_socket_keepalive_timeout) config directive will be used. If the `0` value is given, then the timeout interval is unlimited.
|
||||
|
||||
|
@ -4636,7 +4638,7 @@ and then accessing it from `nginx.conf`:
|
|||
|
||||
|
||||
location /lua {
|
||||
content_lua_by_lua '
|
||||
content_by_lua '
|
||||
local mydata = require "mydata"
|
||||
ngx.say(mydata.get_age("dog"))
|
||||
';
|
||||
|
|
|
@ -228,7 +228,7 @@ and the Lua <code>package.loaded</code> table will be cleared
|
|||
at the entry point of every request (such that Lua modules
|
||||
will not be cached either). With this in place, developers can adopt an edit-and-refresh approach.
|
||||
|
||||
Please note however, that Lua code written inline within nginx.conf
|
||||
Please note however, that Lua code written inlined within nginx.conf
|
||||
such as those specified by [[#set_by_lua|set_by_lua]], [[#content_by_lua|content_by_lua]],
|
||||
[[#access_by_lua|access_by_lua]], and [[#rewrite_by_lua|rewrite_by_lua]] will ''always'' be
|
||||
cached because only the Nginx config file parser can correctly parse the <code>nginx.conf</code>
|
||||
|
@ -3442,6 +3442,8 @@ These two forms are fundamentally equivalent.
|
|||
|
||||
This feature was first introduced in the <code>v0.3.1rc22</code> release.
|
||||
|
||||
Please note that while internally the key-value pair is set atomically, the atomicity does not go across the method call boundary.
|
||||
|
||||
See also [[#ngx.shared.DICT|ngx.shared.DICT]].
|
||||
|
||||
== ngx.shared.DICT.add ==
|
||||
|
@ -3964,7 +3966,7 @@ This feature was first introduced in the <code>v0.5.0rc1</code> release.
|
|||
|
||||
'''context:''' ''rewrite_by_lua*, access_by_lua*, content_by_lua*''
|
||||
|
||||
Puts the current socket's connection into the cosocket built-in connection pool and keep it alive until other [[#tcpsock:connect|connect]] method calls request it or the associated maximal idle timeout is expired.
|
||||
Puts the current socket's connection immediately into the cosocket built-in connection pool and keep it alive until other [[#tcpsock:connect|connect]] method calls request it or the associated maximal idle timeout is expired.
|
||||
|
||||
The first optional argument, <code>timeout</code>, can be used to specify the maximal idle timeout (in milliseconds) for the current connection. If omitted, the default setting in the [[#lua_socket_keepalive_timeout|lua_socket_keepalive_timeout]] config directive will be used. If the <code>0</code> value is given, then the timeout interval is unlimited.
|
||||
|
||||
|
@ -4480,7 +4482,7 @@ and then accessing it from <code>nginx.conf</code>:
|
|||
|
||||
<geshi lang="nginx">
|
||||
location /lua {
|
||||
content_lua_by_lua '
|
||||
content_by_lua '
|
||||
local mydata = require "mydata"
|
||||
ngx.say(mydata.get_age("dog"))
|
||||
';
|
||||
|
|
Загрузка…
Ссылка в новой задаче