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
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ This module is under active development and is production ready.
18
18
Version
19
19
=======
20
20
21
-
This document describes ngx_lua [v0.8.2](https://github.com/chaoslawful/lua-nginx-module/tags) released on 23 May 2013.
21
+
This document describes ngx_lua [v0.8.3](https://github.com/chaoslawful/lua-nginx-module/tags) released on 20 June 2013.
22
22
23
23
Synopsis
24
24
========
@@ -247,6 +247,10 @@ cached because only the Nginx config file parser can correctly parse the `nginx.
247
247
file and the only ways to to reload the config file
248
248
are to send a `HUP` signal or to restart Nginx.
249
249
250
+
Also, Lua files which are loaded by `dofile` or `loadfile`
251
+
in *_by_lua_file will never be cached. To ensure code caching, you can either use the [init_by_lua](http://wiki.nginx.org/HttpLuaModule#init_by_lua)
252
+
or [init_by_lua_file](http://wiki.nginx.org/HttpLuaModule#init-by_lua_file) directives to load all such files or just make these Lua files true Lua modules and load them via `require`.
253
+
250
254
The ngx_lua module does not currently support the `stat` mode available with the
251
255
Apache `mod_lua` module but this is planned for implementation in the future.
252
256
@@ -2559,7 +2563,7 @@ If the request body has been read into disk files, try calling the [ngx.req.get_
2559
2563
2560
2564
To force in-memory request bodies, try setting [client_body_buffer_size](http://wiki.nginx.org/HttpCoreModule#client_body_buffer_size) to the same size value in [client_max_body_size](http://wiki.nginx.org/HttpCoreModule#client_max_body_size).
2561
2565
2562
-
Note that calling this function instead of using `ngx.var.request_body` or `ngx.var.echo_request-body` is more efficient because it can save one dynamic memory allocation and one data copy.
2566
+
Note that calling this function instead of using `ngx.var.request_body` or `ngx.var.echo_request_body` is more efficient because it can save one dynamic memory allocation and one data copy.
2563
2567
2564
2568
This function was first introduced in the `v0.3.1rc17` release.
2565
2569
@@ -2819,12 +2823,14 @@ This method call terminates the current request's processing and never returns.
Since `v0.8.3` this function returns `1` on success, or returns `nil` and a string describing the error otherwise.
2833
+
2828
2834
Note that there is normally no need to manually send out response headers as ngx_lua will automatically send headers out
2829
2835
before content is output with [ngx.say](http://wiki.nginx.org/HttpLuaModule#ngx.say) or [ngx.print](http://wiki.nginx.org/HttpLuaModule#ngx.print) or when [content_by_lua](http://wiki.nginx.org/HttpLuaModule#content_by_lua) exits normally.
2830
2836
@@ -2840,12 +2846,14 @@ This API was first introduced in ngx_lua v0.3.1rc6.
Emits arguments concatenated to the HTTP client (as response body). If response headers have not been sent, this function will send headers out first and then output body data.
2848
2854
2855
+
Since `v0.8.3` this function returns `1` on success, or returns `nil` and a string describing the error otherwise.
2856
+
2849
2857
Lua `nil` values will output `"nil"` strings and Lua boolean values will output `"true"` and `"false"` literal strings respectively.
2850
2858
2851
2859
Nested arrays of strings are permitted and the elements in the arrays will be sent one by one:
@@ -2875,7 +2883,7 @@ Please note that both `ngx.print` and [ngx.say](http://wiki.nginx.org/HttpLuaMod
@@ -2911,6 +2919,8 @@ When `ngx.flush(true)` is called immediately after [ngx.print](http://wiki.nginx
2911
2919
2912
2920
Note that `ngx.flush` is non functional when in the HTTP 1.0 output buffering mode. See [HTTP 1.0 support](http://wiki.nginx.org/HttpLuaModule#HTTP_1.0_support).
2913
2921
2922
+
Since `v0.8.3` this function returns `1` on success, or returns `nil` and a string describing the error otherwise.
2923
+
2914
2924
ngx.exit
2915
2925
--------
2916
2926
**syntax:***ngx.exit(status)*
@@ -2959,7 +2969,7 @@ It is recommended, though not necessary, to combine the `return` statement with
Copy file name to clipboardExpand all lines: doc/HttpLuaModule.wiki
+24-10Lines changed: 24 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This module is under active development and is production ready.
10
10
11
11
= Version =
12
12
13
-
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.8.2] released on 23 May 2013.
13
+
This document describes ngx_lua [https://github.com/chaoslawful/lua-nginx-module/tags v0.8.3] released on 20 June 2013.
14
14
15
15
= Synopsis =
16
16
<geshi lang="nginx">
@@ -235,6 +235,11 @@ cached because only the Nginx config file parser can correctly parse the <code>n
235
235
file and the only ways to to reload the config file
236
236
are to send a <code>HUP</code> signal or to restart Nginx.
237
237
238
+
Also, Lua files which are loaded by <code>dofile</code> or <code>loadfile</code>
239
+
in *_by_lua_file will never be cached. To ensure code caching, you can either use the [[#init_by_lua|init_by_lua]]
240
+
or [[#init-by_lua_file|init_by_lua_file]] directives to load all such files or just make these Lua files true Lua modules
241
+
and load them via <code>require</code>.
242
+
238
243
The ngx_lua module does not currently support the <code>stat</code> mode available with the
239
244
Apache <code>mod_lua</code> module but this is planned for implementation in the future.
240
245
@@ -2483,7 +2488,7 @@ If the request body has been read into disk files, try calling the [[#ngx.req.ge
2483
2488
2484
2489
To force in-memory request bodies, try setting [[HttpCoreModule#client_body_buffer_size|client_body_buffer_size]] to the same size value in [[HttpCoreModule#client_max_body_size|client_max_body_size]].
2485
2490
2486
-
Note that calling this function instead of using <code>ngx.var.request_body</code> or <code>ngx.var.echo_request-body</code> is more efficient because it can save one dynamic memory allocation and one data copy.
2491
+
Note that calling this function instead of using <code>ngx.var.request_body</code> or <code>ngx.var.echo_request_body</code> is more efficient because it can save one dynamic memory allocation and one data copy.
2487
2492
2488
2493
This function was first introduced in the <code>v0.3.1rc17</code> release.
2489
2494
@@ -2733,12 +2738,14 @@ URI arguments can be specified as well, for example:
2733
2738
This method call terminates the current request's processing and never returns. It is recommended to combine the <code>return</code> statement with this call, i.e., <code>return ngx.redirect(...)</code>, so as to be more explicit.
Emits arguments concatenated to the HTTP client (as response body). If response headers have not been sent, this function will send headers out first and then output body data.
2760
2767
2768
+
Since <code>v0.8.3</code> this function returns <code>1</code> on success, or returns <code>nil</code> and a string describing the error otherwise.
2769
+
2761
2770
Lua <code>nil</code> values will output <code>"nil"</code> strings and Lua boolean values will output <code>"true"</code> and <code>"false"</code> literal strings respectively.
2762
2771
2763
2772
Nested arrays of strings are permitted and the elements in the arrays will be sent one by one:
@@ -2786,7 +2795,7 @@ This is an asynchronous call and will return immediately without waiting for all
2786
2795
Please note that both <code>ngx.print</code> and [[#ngx.say|ngx.say]] will always invoke the whole Nginx output body filter chain, which is an expensive operation. So be careful when calling either of these two in a tight loop; buffer the data yourself in Lua and save the calls.
@@ -2806,7 +2815,7 @@ The <code>log_level</code> argument can take constants like <code>ngx.ERR</code>
2806
2815
There is a hard coded <code>2048</code> byte limitation on error message lengths in the Nginx core. This limit includes trailing newlines and leading time stamps. If the message size exceeds this limit, Nginx will truncate the message text accordingly. This limit can be manually modified by editing the <code>NGX_MAX_ERROR_STR</code> macro definition in the <code>src/core/ngx_log.h</code> file in the Nginx source tree.
@@ -2820,6 +2829,8 @@ When <code>ngx.flush(true)</code> is called immediately after [[#ngx.print|ngx.p
2820
2829
2821
2830
Note that <code>ngx.flush</code> is non functional when in the HTTP 1.0 output buffering mode. See [[#HTTP 1.0 support|HTTP 1.0 support]].
2822
2831
2832
+
Since <code>v0.8.3</code> this function returns <code>1</code> on success, or returns <code>nil</code> and a string describing the error otherwise.
2833
+
2823
2834
== ngx.exit ==
2824
2835
'''syntax:''' ''ngx.exit(status)''
2825
2836
@@ -2866,7 +2877,7 @@ Note that while this method accepts all [[#HTTP status constants|HTTP status con
2866
2877
It is recommended, though not necessary, to combine the <code>return</code> statement with this call, i.e., <code>return ngx.exit(...)</code>, to give a visual hint to others reading the code.
0 commit comments