forked from openresty/openresty.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xml
executable file
·358 lines (312 loc) · 185 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>OpenResty</title>
<description>a fast web app server by extending nginx </description>
<language>en</language>
<copyright>Copyright 2014 YichunZhang</copyright>
<pubDate>Fri, 10 Oct 2014 00:02:16 GMT</pubDate>
<lastBuildDate>Fri, 10 Oct 2014 00:02:16 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>TiddlyWiki 2.6.2</generator>
<item>
<title>Changes</title>
<description><a tiddler="Changes" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><ul><li> <a tiddlylink="ChangeLog1007004" refresh="link" target="_blank" title="External link to null#ChangeLog1007004" href="null#ChangeLog1007004" class="externalLink null">Release 1.7.4.x</a></li><li> <a tiddlylink="ChangeLog1007002" refresh="link" target="_blank" title="External link to null#ChangeLog1007002" href="null#ChangeLog1007002" class="externalLink null">Release 1.7.2.x</a></li><li> <a tiddlylink="ChangeLog1007000" refresh="link" target="_blank" title="External link to null#ChangeLog1007000" href="null#ChangeLog1007000" class="externalLink null">Release 1.7.0.x</a></li><li> <a tiddlylink="ChangeLog1005012" refresh="link" target="_blank" title="External link to null#ChangeLog1005012" href="null#ChangeLog1005012" class="externalLink null">Release 1.5.12.x</a></li><li> <a tiddlylink="ChangeLog1005011" refresh="link" target="_blank" title="External link to null#ChangeLog1005011" href="null#ChangeLog1005011" class="externalLink null">Release 1.5.11.x</a></li><li> <a tiddlylink="ChangeLog1005008" refresh="link" target="_blank" title="External link to null#ChangeLog1005008" href="null#ChangeLog1005008" class="externalLink null">Release 1.5.8.x</a></li><li> <a tiddlylink="ChangeLog1004003" refresh="link" target="_blank" title="External link to null#ChangeLog1004003" href="null#ChangeLog1004003" class="externalLink null">Release 1.4.3.x</a></li><li> <a tiddlylink="ChangeLog1004002" refresh="link" target="_blank" title="External link to null#ChangeLog1004002" href="null#ChangeLog1004002" class="externalLink null">Release 1.4.2.x</a></li><li> <a tiddlylink="ChangeLog1004001" refresh="link" target="_blank" title="External link to null#ChangeLog1004001" href="null#ChangeLog1004001" class="externalLink null">Release 1.4.1.x</a></li><li> <a tiddlylink="ChangeLog1002008" refresh="link" target="_blank" title="External link to null#ChangeLog1002008" href="null#ChangeLog1002008" class="externalLink null">Release 1.2.8.x</a></li><li> <a tiddlylink="ChangeLog1002007" refresh="link" target="_blank" title="External link to null#ChangeLog1002007" href="null#ChangeLog1002007" class="externalLink null">Release 1.2.7.x</a></li><li> <a tiddlylink="ChangeLog1002006" refresh="link" target="_blank" title="External link to null#ChangeLog1002006" href="null#ChangeLog1002006" class="externalLink null">Release 1.2.6.x</a></li><li> <a tiddlylink="ChangeLog1002004" refresh="link" target="_blank" title="External link to null#ChangeLog1002004" href="null#ChangeLog1002004" class="externalLink null">Release 1.2.4.x</a></li><li> <a tiddlylink="ChangeLog1002003" refresh="link" target="_blank" title="External link to null#ChangeLog1002003" href="null#ChangeLog1002003" class="externalLink null">Release 1.2.3.x</a></li><li> <a tiddlylink="ChangeLog1002001" refresh="link" target="_blank" title="External link to null#ChangeLog1002001" href="null#ChangeLog1002001" class="externalLink null">Release 1.2.1.x</a></li><li> <a tiddlylink="ChangeLog1000015" refresh="link" target="_blank" title="External link to null#ChangeLog1000015" href="null#ChangeLog1000015" class="externalLink null">Release 1.0.15.x</a></li><li> <a tiddlylink="ChangeLog1000011" refresh="link" target="_blank" title="External link to null#ChangeLog1000011" href="null#ChangeLog1000011" class="externalLink null">Release 1.0.11.x</a></li><li> <a tiddlylink="ChangeLog1000010" refresh="link" target="_blank" title="External link to null#ChangeLog1000010" href="null#ChangeLog1000010" class="externalLink null">Release 1.0.10.x</a></li><li> <a tiddlylink="ChangeLog1000009" refresh="link" target="_blank" title="External link to null#ChangeLog1000009" href="null#ChangeLog1000009" class="externalLink null">Release 1.0.9.x</a></li><li> <a tiddlylink="ChangeLog1000008" refresh="link" target="_blank" title="External link to null#ChangeLog1000008" href="null#ChangeLog1000008" class="externalLink null">Release 1.0.8.x</a></li><li> <a tiddlylink="ChangeLog1000006" refresh="link" target="_blank" title="External link to null#ChangeLog1000006" href="null#ChangeLog1000006" class="externalLink null">Release 1.0.6.x</a></li><li> <a tiddlylink="ChangeLog1000005" refresh="link" target="_blank" title="External link to null#ChangeLog1000005" href="null#ChangeLog1000005" class="externalLink null">Release 1.0.5.x</a></li><li> <a tiddlylink="ChangeLog1000004" refresh="link" target="_blank" title="External link to null#ChangeLog1000004" href="null#ChangeLog1000004" class="externalLink null">Release 1.0.4.x</a></li><li> <a tiddlylink="ChangeLog8054" refresh="link" target="_blank" title="External link to null#ChangeLog8054" href="null#ChangeLog8054" class="externalLink null">Release 0.8.54.x</a></li></ul></description>
<link>null#Changes</link>
<pubDate>Fri, 10 Oct 2014 00:02:16 GMT</pubDate>
</item>
<item>
<title>ChangeLog1007004</title>
<description><a tiddler="ChangeLog1007004" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><h1> Version 1.7.4.1 - 9 October 2014</h1><ul><li> upgraded the Nginx core to 1.7.4.<ul><li> see the changes here: <a target="_blank" title="External link to http://nginx.org/en/CHANGES" href="http://nginx.org/en/CHANGES" class="externalLink">http://nginx.org/en/CHANGES</a></li></ul></li><li> feature: added a new command-line utility, <code>resty</code>, to run Lua code or Lua files (for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>) directly from the command-line. it is installed into the "&lt;prefix&gt;/bin" directory. prodded by Vitaly Kosenko. This tool is currently experimental.</li><li> bugfix: <code>./configure</code>: we might misuse the homebrew version of <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> on Mac OS X when the user specified the <code>--with-ld-opt="-L/usr/local/lib"</code> option. thanks Aapo Talvensaari for the report.</li><li> bugfix: <code>util/install</code>: remove the target file before overwriting to prevent running processes (if any) from crashing.</li><li> bugfix: <code>./configure</code>: call "sh" explicitly for nginx's <code>./configure</code> script to prevent potential file permission issues.</li><li> optimize: now we use the C compiler option <code>-O2</code> for everything by default (we used to use <code>-O1</code> which is too conservative).</li><li> upgraded <a tiddlylink="PostgresNginxModule" refresh="link" target="_blank" title="External link to null#PostgresNginxModule" href="null#PostgresNginxModule" class="externalLink null">PostgresNginxModule</a> to 1.0rc4.<ul><li> bugfix: segmentation fault might happen in <code>ngx_destroy_pool</code> when debug logging was enabled in the nginx build. thanks buddy-ekb for the report.</li></ul></li><li> upgraded <a tiddlylink="EchoNginxModule" refresh="link" target="_blank" title="External link to null#EchoNginxModule" href="null#EchoNginxModule" class="externalLink null">EchoNginxModule</a> to 0.56.<ul><li> bugfix: our <code>create_loc_conf</code> callback did not return NULL on error. thanks Markus Linnala for the patch.</li><li> bugfix: reading <a target="_blank" title="External link to https://github.com/openresty/echo-nginx-module#echo_client_request_headers" href="https://github.com/openresty/echo-nginx-module#echo_client_request_headers" class="externalLink">$echo_client_request_headers</a> would return garbled data when LF instead of CRLF is used as the line terminator in the original header.</li><li> bugfix: reading <a target="_blank" title="External link to https://github.com/openresty/echo-nginx-module#echo_client_request_headers" href="https://github.com/openresty/echo-nginx-module#echo_client_request_headers" class="externalLink">$echo_client_request_headers</a> could lead to buffer overflow due to misuse of <code>r-&gt;header_end</code> while modules like ngx_fastcgi and ngx_proxy can change <code>r-&gt;header_end</code> to point to buffers of their own.</li></ul></li><li> upgraded <a tiddlylink="FormInputNginxModule" refresh="link" target="_blank" title="External link to null#FormInputNginxModule" href="null#FormInputNginxModule" class="externalLink null">FormInputNginxModule</a> to 0.10.<ul><li> bugfix: "pcre_exec -2" error might happen when the standard "if" directive is used to test the empty value nginx variables set by this module with a regex. (Jiale)</li><li> bugfix: we incorrectly overrode <code>r-&gt;read_event_handler</code> with <code>ngx_http_request_empty_handler</code> in our "post read" callback for client request body reading, which could waste CPU time in level-triggered event models like poll and select. thanks chen for the catch.</li></ul></li><li> upgraded <a tiddlylink="SetMiscNginxModule" refresh="link" target="_blank" title="External link to null#SetMiscNginxModule" href="null#SetMiscNginxModule" class="externalLink null">SetMiscNginxModule</a> 0.26.<ul><li> change: <a target="_blank" title="External link to https://github.com/openresty/set-misc-nginx-module#set_escape_uri" href="https://github.com/openresty/set-misc-nginx-module#set_escape_uri" class="externalLink">set_escape_uri</a>: use uppercase hexadecimal digits for percent-encoding as per RFC 3986. thanks splitice for the original patch.</li><li> bugfix: our <code>create_loc_conf</code> callback did not return NULL on error. thanks Markus Linnala for the patch.</li><li> bugfix: fixed source and test files' permission. they should not be executable at all. thanks Christos Kontas for the report.</li></ul></li><li> upgraded <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> to v2.1-20140805: <a target="_blank" title="External link to https://github.com/openresty/luajit2/tags" href="https://github.com/openresty/luajit2/tags" class="externalLink">https://github.com/openresty/luajit2/tags</a><ul><li> imported Mike Pall's latest bug fixes:<ul><li> FFI: Fix <code>__index</code>/<code>__newindex</code> metamethod resolution for ctypes.</li><li> Invalidate backpropagation cache after DCE.</li></ul></li></ul></li><li> upgraded <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> to 0.9.12.<ul><li> feature: implemented the SSL/TLS cosocket API.<ul><li> added new method <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake" href="https://github.com/openresty/lua-nginx-module#tcpsocksslhandshake" class="externalLink">sslhandshake()</a> to the <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxsockettcp" href="https://github.com/openresty/lua-nginx-module#ngxsockettcp" class="externalLink">stream-typed cosocket</a> objects.</li><li> added new configuration directives <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_ssl_trusted_certificate" href="https://github.com/openresty/lua-nginx-module#lua_ssl_trusted_certificate" class="externalLink">lua_ssl_trusted_certificate</a>, <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_ssl_verify_depth" href="https://github.com/openresty/lua-nginx-module#lua_ssl_verify_depth" class="externalLink">lua_ssl_verify_depth</a>, <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_ssl_crl" href="https://github.com/openresty/lua-nginx-module#lua_ssl_crl" class="externalLink">lua_ssl_crl</a>, <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_ssl_protocols" href="https://github.com/openresty/lua-nginx-module#lua_ssl_protocols" class="externalLink">lua_ssl_protocols</a>, and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_ssl_ciphers" href="https://github.com/openresty/lua-nginx-module#lua_ssl_ciphers" class="externalLink">lua_ssl_ciphers</a>. thanks aviramc for the original patch.</li></ul></li><li> feature: the standard coroutine API is now enabled in the context of <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#header_filter_by_lua" href="https://github.com/openresty/lua-nginx-module#header_filter_by_lua" class="externalLink">header_filter_by_lua*</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#body_filter_by_lua" href="https://github.com/openresty/lua-nginx-module#body_filter_by_lua" class="externalLink">body_filter_by_lua*</a>. thanks ngo for the request.</li><li> feature: for content/rewrite/access_by_lua_file directives, we now return 404 status code instead of 500 in case that the specified .lua file cannot be opened. thanks Sam Lee for the suggestion.</li><li> feature: added pure C API function for FFI-based implementation of reading <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxheaderheader" href="https://github.com/openresty/lua-nginx-module#ngxheaderheader" class="externalLink">ngx.header.HEADER</a>.</li><li> feature: now we also explicitly check the Lua ABI/language version in our feature test of the <code>./configure</code> phase for a usable Lua lib.</li><li> feature: added pure C API functions for FFI-based implementations of <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxworkerpid" href="https://github.com/openresty/lua-nginx-module#ngxworkerpid" class="externalLink">ngx.worker.pid()</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxworkerexiting" href="https://github.com/openresty/lua-nginx-module#ngxworkerexiting" class="externalLink">ngx.worker.exiting()</a>.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxreqraw_header" href="https://github.com/openresty/lua-nginx-module#ngxreqraw_header" class="externalLink">ngx.req.raw_header()</a> could lead to buffer overflow and the "userdata length overflow" error due to misuse of <code>r-&gt;header_end</code> while modules like ngx_fastcgi and ngx_proxy can change <code>r-&gt;header_end</code> to point to buffers of their own. thanks sadmedved for the report.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxreqraw_header" href="https://github.com/openresty/lua-nginx-module#ngxreqraw_header" class="externalLink">ngx.req.raw_header()</a> would return garbled data when LF instead of CRLF is used as the line terminator in the original header.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#body_filter_by_lua" href="https://github.com/openresty/lua-nginx-module#body_filter_by_lua" class="externalLink">body_filter_by_lua*</a>: reading <code>ngx.arg[1]</code> after clearing <code>ngx.arg[1]</code> (by assigning nil or "") could lead to segmentation faults. this regression had appeared in v0.9.10. thanks Jason Stangroome for the report.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#init_worker_by_lua_file" href="https://github.com/openresty/lua-nginx-module#init_worker_by_lua_file" class="externalLink">init_worker_by_lua*</a> would conflict with some other nginx C modules (like ngx_proxy) when their <code>merge_loc_conf</code> callbacks (or alike) produce side-effects in <code>cf-&gt;cycle</code>. thanks Ruoshan Huang for the report.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxsockettcp" href="https://github.com/openresty/lua-nginx-module#ngxsockettcp" class="externalLink">stream-typed cosocket</a> might read uninitialized memory bytes when logging errors due to sending to or receiving from a closed socket.</li><li> bugfix: the stream-typed and datagram-typed cosockets' resolver handler did not handle some special errors correctly.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxrespget_headers" href="https://github.com/openresty/lua-nginx-module#ngxrespget_headers" class="externalLink">ngx.resp.get_headers()</a>: sometimes we might omit the builtin-headers Content-Type, Content-Length, Connection, and Transfer-Encoding. thanks Jon Keys for the report.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxreqsocket" href="https://github.com/openresty/lua-nginx-module#ngxreqsocket" class="externalLink">ngx.req.socket(true)</a>: it incrrectly returned the error "chunked request bodies not supported yet" for raw request sockets with chunked request bodies. thanks Xiaofei Yang for the report.</li><li> bugfix: we did not check allocation failures while compiling the pattern for <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#tcpsockreceiveuntil" href="https://github.com/openresty/lua-nginx-module#tcpsockreceiveuntil" class="externalLink">tcpsock:receiveuntil()</a>. thanks Tatsuhiko Kubo for the patch.</li><li> bugfix: we did not use <code>lua_checkstack()</code> to prevent Lua stack overflow in our own C-land Lua backtrace generator.</li><li> bugfix: fixed an incorrect error message. thanks aviramc for the patch.</li><li> bugfix: for statically linked <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a>, we need to pass <code>-ldl</code> to the linker. thanks cf2012 for the report.</li><li> bugfix: the <a target="_blank" title="External link to http://nginx.org/en/docs/http/ngx_http_core_module.html#tcp_nodelay" href="http://nginx.org/en/docs/http/ngx_http_core_module.html#tcp_nodelay" class="externalLink">tcp_nodelay</a> directive configuration was not honored by upstream TCP cosockets, which could lead to extra delays for small messages. thanks Shun Zhang for reporting this issue.</li><li> bugfix: fixed build failures with OpenSSL older than 0.9.8f. thanks FFCZ for the report.</li><li> bugfix: compilation failed with nginx 1.3.6 or older. this regression had appeared in the v0.9.11 release.</li><li> bugfix: compilation failed with nginx 0.9.x.</li><li> bugfix: our <code>create_loc_conf</code> callback did not return NULL on error.</li><li> bugfix: added allocation failure check for <code>ngx_array_init()</code> on the C land. thanks Tatsuhiko Kubo for the patch.</li><li> optimize: we now cache the userdata metatable (for the <code>__gc</code> metamethod) in the lua registry for both the stream-typed datagram-typed cosockets.</li><li> optimize: reading <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxheaderheader" href="https://github.com/openresty/lua-nginx-module#ngxheaderheader" class="externalLink">ngx.header.HEADER</a>: eliminated dynamic allocations and data copying when there is no need to ransform "_" to "-" in the header name.</li><li> change: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxescape_uri" href="https://github.com/openresty/lua-nginx-module#ngxescape_uri" class="externalLink">ngx.escape_uri()</a> now uses uppercase hexadecimal digits for percent-encoding according to the recommendation in RFC 3986. thanks Piotr Sikora for the suggestion.</li><li> change: use the type <code>ngx_http_lua_ffi_str_t</code> instead of <code>ngx_str_t</code> in the pure C API function <code>ngx_http_lua_ffi_req_get_headers</code>.</li><li> change: renamed the C macro <code>NGX_HTTP_LUA_NO_FFI_API</code> to <code>NGX_LUA_NO_FFI_API</code>.</li><li> style: various coding style fixes and minor optimizations from Tatsuhiko Kubo.</li><li> doc: documented the behavior of <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#init_by_lua" href="https://github.com/openresty/lua-nginx-module#init_by_lua" class="externalLink">init_by_lua*</a> when <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_code_cache" href="https://github.com/openresty/lua-nginx-module#lua_code_cache" class="externalLink">lua_code_cache</a> is off.</li><li> doc: fixed a wrong statement regarding <code>require()</code> in the "Lua Variable Scope" section. thanks Hungpu DU for the report.</li><li> doc: more clarification in the docs for the "res.truncated" flag returned by <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxlocationcapture" href="https://github.com/openresty/lua-nginx-module#ngxlocationcapture" class="externalLink">ngx.location.capture()</a>. thanks Jon Keys for asking.</li><li> doc: added missing method name "get_keys" under "ngx.shared.DICT" and also fixed the method order. thanks George Bashi for the patch.</li><li> doc: markdown: fixed the "Back to TOC" links for the sections ("Nginx API for Lua" and "Directives") with inlined TOC. thanks Pierre-Yves Gérardy and Simon Eskildsen for the reports.</li><li> doc: improved the wording in the "Lua Coroutine Yielding/Resuming" section. thanks Hungpu DU for the report.</li><li> doc: improved the wording of the documentation for <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxreqclear_header" href="https://github.com/openresty/lua-nginx-module#ngxreqclear_header" class="externalLink">ngx.req.clear_header()</a> to prevent ambiguity. thanks Christophe-Marie Duquesne for the report.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a> to 0.0.9.<ul><li> feature: implemented the reading part of <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxheaderheader" href="https://github.com/openresty/lua-nginx-module#ngxheaderheader" class="externalLink">ngx.header.HEADER</a> with FFI.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxworkerpid" href="https://github.com/openresty/lua-nginx-module#ngxworkerpid" class="externalLink">ngx.worker.pid()</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxworkerexiting" href="https://github.com/openresty/lua-nginx-module#ngxworkerexiting" class="externalLink">ngx.worker.exiting()</a> with FFI.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyUpstreamHealthcheckLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyUpstreamHealthcheckLibrary" href="null#LuaRestyUpstreamHealthcheckLibrary" class="externalLink null">LuaRestyUpstreamHealthcheckLibrary</a> to 0.03.<ul><li> optimize: timers in different nginx worker processes can go out of phase as time goes, resulting in duplicate test requests from different workers in the same check interval. thanks fancyrabbit for the report and fix.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyWebSocketLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyWebSocketLibrary" href="null#LuaRestyWebSocketLibrary" class="externalLink null">LuaRestyWebSocketLibrary</a> to 0.04.<ul><li> feature: <a target="_blank" title="External link to https://github.com/openresty/lua-resty-websocket#restywebsocketclient" href="https://github.com/openresty/lua-resty-websocket#restywebsocketclient" class="externalLink">resty.websocket.client</a>: added support for the "origin" option to specify the value of the <code>Origin</code> request header. thanks woo for the original patch.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-resty-websocket#restywebsocketclient" href="https://github.com/openresty/lua-resty-websocket#restywebsocketclient" class="externalLink">resty.websocket.client</a>: connection pooling was broken due to duplicate websocket handshakes. thanks woo for the patch.</li><li> bugfix: fixed the <code>Sec-WebSocket-Protocol</code> header when the secondary protocols are specified. thanks woo for the report.</li><li> doc: typo fixes from Laurent Arnoud.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyDNSLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyDNSLibrary" href="null#LuaRestyDNSLibrary" class="externalLink null">LuaRestyDNSLibrary</a> to 0.13.<ul><li> bugfix: we did not parse the character-strings in the "TXT" record data. thanks Kevin Ingersoll for the report.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyMySQLLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyMySQLLibrary" href="null#LuaRestyMySQLLibrary" class="externalLink null">LuaRestyMySQLLibrary</a> to 0.15.<ul><li> feature: added new boolean-value options "ssl" and "ssl_verify" to the <a target="_blank" title="External link to https://github.com/openresty/lua-resty-mysql#connect" href="https://github.com/openresty/lua-resty-mysql#connect" class="externalLink">connect()</a> method connecting to MySQL via SSL.</li></ul></li><li> upgraded <a tiddlylink="LuaCjsonLibrary" refresh="link" target="_blank" title="External link to null#LuaCjsonLibrary" href="null#LuaCjsonLibrary" class="externalLink null">LuaCjsonLibrary</a> to 2.1.0.2.<ul><li> bugfix: the Makefile had a bug that overwrites the existing <code>cjson.so</code> file in place which could cause already running processes with this <code>.so</code> file loaded to crash. thanks ywsample for the report.</li></ul></li></ul>See <a tiddlylink="ChangeLog1007002" refresh="link" target="_blank" title="External link to null#ChangeLog1007002" href="null#ChangeLog1007002" class="externalLink null">ChangeLog1007002</a> for change log for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> 1.7.2.x.</description>
<link>null#ChangeLog1007004</link>
<pubDate>Fri, 10 Oct 2014 00:00:15 GMT</pubDate>
</item>
<item>
<title>Download</title>
<description><a tiddler="Download" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br>You can download the latest release tarball below. After that, you can follow the instructions on the <a tiddlylink="Installation" refresh="link" target="_blank" title="External link to null#Installation" href="null#Installation" class="externalLink null">Installation</a> page to build and install it.<br><h1>Releases</h1><h2> Lastest release</h2><ul><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.7.4.1.tar.gz" href="http://openresty.org/download/ngx_openresty-1.7.4.1.tar.gz" class="externalLink">ngx_openresty-1.7.4.1.tar.gz</a> <span>&nbsp;</span> 3.2MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.7.4.1.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.7.4.1.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1007004" refresh="link" target="_blank" title="External link to null#ChangeLog1007004" href="null#ChangeLog1007004" class="externalLink null">Changes</a> - 9 October 2014</li></ul><h2> Legacy releases</h2>Sometimes, users may want to download old releases.<br><ul><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz" href="http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz" class="externalLink">ngx_openresty-1.7.2.1.tar.gz</a> <span>&nbsp;</span> 3.2MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1007002" refresh="link" target="_blank" title="External link to null#ChangeLog1007002" href="null#ChangeLog1007002" class="externalLink null">Changes</a> - 12 July 2014</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.7.0.1.tar.gz" href="http://openresty.org/download/ngx_openresty-1.7.0.1.tar.gz" class="externalLink">ngx_openresty-1.7.0.1.tar.gz</a> <span>&nbsp;</span> 3.1MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.7.0.1.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.7.0.1.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1007000" refresh="link" target="_blank" title="External link to null#ChangeLog1007000" href="null#ChangeLog1007000" class="externalLink null">Changes</a> - 7 June 2014</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.5.12.1.tar.gz" href="http://openresty.org/download/ngx_openresty-1.5.12.1.tar.gz" class="externalLink">ngx_openresty-1.5.12.1.tar.gz</a> <span>&nbsp;</span> 3.1MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.5.12.1.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.5.12.1.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1005012" refresh="link" target="_blank" title="External link to null#ChangeLog1005012" href="null#ChangeLog1005012" class="externalLink null">Changes</a> - 29 April 2014</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz" href="http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz" class="externalLink">ngx_openresty-1.5.11.1.tar.gz</a> <span>&nbsp;</span> 3.1MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1005011" refresh="link" target="_blank" title="External link to null#ChangeLog1005011" href="null#ChangeLog1005011" class="externalLink null">Changes</a> - 30 March 2014</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz" href="http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz" class="externalLink">ngx_openresty-1.5.8.1.tar.gz</a> <span>&nbsp;</span> 3.1MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1005008" refresh="link" target="_blank" title="External link to null#ChangeLog1005008" href="null#ChangeLog1005008" class="externalLink null">Changes</a> - 10 January 2014</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz" href="http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz" class="externalLink">ngx_openresty-1.4.3.6.tar.gz</a> <span>&nbsp;</span> 3.1MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1004003" refresh="link" target="_blank" title="External link to null#ChangeLog1004003" href="null#ChangeLog1004003" class="externalLink null">Changes</a> - 20 November 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.4.3.4.tar.gz" href="http://openresty.org/download/ngx_openresty-1.4.3.4.tar.gz" class="externalLink">ngx_openresty-1.4.3.4.tar.gz</a> <span>&nbsp;</span> 3.1MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.4.3.4.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.4.3.4.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1004003" refresh="link" target="_blank" title="External link to null#ChangeLog1004003" href="null#ChangeLog1004003" class="externalLink null">Changes</a> - 12 November 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.4.2.8.tar.gz" href="http://openresty.org/download/ngx_openresty-1.4.2.8.tar.gz" class="externalLink">ngx_openresty-1.4.2.8.tar.gz</a> <span>&nbsp;</span> 3.0MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.4.2.8.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.4.2.8.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1004002" refresh="link" target="_blank" title="External link to null#ChangeLog1004002" href="null#ChangeLog1004002" class="externalLink null">Changes</a> - 22 September 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz" class="externalLink">ngx_openresty-1.2.8.6.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002008" refresh="link" target="_blank" title="External link to null#ChangeLog1002008" href="null#ChangeLog1002008" class="externalLink null">Changes</a> - 10 June 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.7.8.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.7.8.tar.gz" class="externalLink">ngx_openresty-1.2.7.8.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.7.8.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.7.8.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002007" refresh="link" target="_blank" title="External link to null#ChangeLog1002007" href="null#ChangeLog1002007" class="externalLink null">Changes</a> - 13 May 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.7.6.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.7.6.tar.gz" class="externalLink">ngx_openresty-1.2.7.6.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.7.6.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.7.6.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002007" refresh="link" target="_blank" title="External link to null#ChangeLog1002007" href="null#ChangeLog1002007" class="externalLink null">Changes</a> - 17 April 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.6.6.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.6.6.tar.gz" class="externalLink">ngx_openresty-1.2.6.6.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.6.6.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.6.6.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002006" refresh="link" target="_blank" title="External link to null#ChangeLog1002006" href="null#ChangeLog1002006" class="externalLink null">Changes</a> - 17 February 2013</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.4.14.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.4.14.tar.gz" class="externalLink">ngx_openresty-1.2.4.14.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.4.14.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.4.14.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002004" refresh="link" target="_blank" title="External link to null#ChangeLog1002004" href="null#ChangeLog1002004" class="externalLink null">Changes</a> - 23 December 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.3.8.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.3.8.tar.gz" class="externalLink">ngx_openresty-1.2.3.8.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.3.8.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.3.8.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002003" refresh="link" target="_blank" title="External link to null#ChangeLog1002003" href="null#ChangeLog1002003" class="externalLink null">Changes</a> - 8 October 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.1.14.tar.gz" href="http://openresty.org/download/ngx_openresty-1.2.1.14.tar.gz" class="externalLink">ngx_openresty-1.2.1.14.tar.gz</a> <span>&nbsp;</span> 2.9MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.2.1.14.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.2.1.14.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1002001" refresh="link" target="_blank" title="External link to null#ChangeLog1002001" href="null#ChangeLog1002001" class="externalLink null">Changes</a> - 14 August 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.15.10.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.15.10.tar.gz" class="externalLink">ngx_openresty-1.0.15.10.tar.gz</a> <span>&nbsp;</span> 2.7MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.15.10.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.15.10.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000015" refresh="link" target="_blank" title="External link to null#ChangeLog1000015" href="null#ChangeLog1000015" class="externalLink null">Changes</a> - 13 June 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.11.28.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.11.28.tar.gz" class="externalLink">ngx_openresty-1.0.11.28.tar.gz</a> <span>&nbsp;</span> 2.7MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.11.28.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.11.28.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000011" refresh="link" target="_blank" title="External link to null#ChangeLog1000011" href="null#ChangeLog1000011" class="externalLink null">Changes</a> - 25 March 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.10.48.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.10.48.tar.gz" class="externalLink">ngx_openresty-1.0.10.48.tar.gz</a> <span>&nbsp;</span> 2.6MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.10.48.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.10.48.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000010" refresh="link" target="_blank" title="External link to null#ChangeLog1000010" href="null#ChangeLog1000010" class="externalLink null">Changes</a> - 1 February 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.10.44.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.10.44.tar.gz" class="externalLink">ngx_openresty-1.0.10.44.tar.gz</a> <span>&nbsp;</span> 2.5MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.10.44.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.10.44.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000010" refresh="link" target="_blank" title="External link to null#ChangeLog1000010" href="null#ChangeLog1000010" class="externalLink null">Changes</a> - 16 January 2012</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.10.24.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.10.24.tar.gz" class="externalLink">ngx_openresty-1.0.10.24.tar.gz</a> <span>&nbsp;</span> 2.5MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.10.24.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.10.24.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000010" refresh="link" target="_blank" title="External link to null#ChangeLog1000010" href="null#ChangeLog1000010" class="externalLink null">Changes</a> - 11 December 2011</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.9.10.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.9.10.tar.gz" class="externalLink">ngx_openresty-1.0.9.10.tar.gz</a> <span>&nbsp;</span> 2.5MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.9.10.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.9.10.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000009" refresh="link" target="_blank" title="External link to null#ChangeLog1000009" href="null#ChangeLog1000009" class="externalLink null">Changes</a> - 16 November 2011</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.8.26.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.8.26.tar.gz" class="externalLink">ngx_openresty-1.0.8.26.tar.gz</a> <span>&nbsp;</span> 2.5MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.8.26.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.8.26.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000008" refresh="link" target="_blank" title="External link to null#ChangeLog1000008" href="null#ChangeLog1000008" class="externalLink null">Changes</a> - 3 November 2011</li><li> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.6.22.tar.gz" href="http://openresty.org/download/ngx_openresty-1.0.6.22.tar.gz" class="externalLink">ngx_openresty-1.0.6.22.tar.gz</a> <span>&nbsp;</span> 2.4MB <span>&nbsp;</span> <a target="_blank" title="External link to http://openresty.org/download/ngx_openresty-1.0.6.22.tar.gz.asc" href="http://openresty.org/download/ngx_openresty-1.0.6.22.tar.gz.asc" class="externalLink">PGP</a> <span>&nbsp;</span> <a tiddlylink="ChangeLog1000006" refresh="link" target="_blank" title="External link to null#ChangeLog1000006" href="null#ChangeLog1000006" class="externalLink null">Changes</a> - 7 October 2011</li></ul><br>See <a tiddlylink="Installation" refresh="link" target="_blank" title="External link to null#Installation" href="null#Installation" class="externalLink null">Installation</a> for installation instructions.<br></description>
<category>Resources</category>
<link>null#Download</link>
<pubDate>Thu, 09 Oct 2014 23:52:56 GMT</pubDate>
</item>
<item>
<title>Installation</title>
<description><a tiddler="Installation" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br>If you haven't downloaded the <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> source code tarball, please go to the <a tiddlylink="Download" refresh="link" target="_blank" title="External link to null#Download" href="null#Download" class="externalLink null">Download</a> page first.<br><br>Basically, building and installing <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> is as simple as<br><pre>tar xzvf ngx_openresty-VERSION.tar.gz
cd ngx_openresty-VERSION/
./configure
make
make install
</pre>where <code>VERSION</code> should be replaced by a concrete version number of <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>, like <code>0.8.54.6</code>.<br><br>If your system environment is modern enough, then you almost always want to enable the PCRE JIT support and IPv6 support in your NGINX by passing the <code>--with-pcre-jit</code> and <code>--with-ipv6</code> options to the <code>./configure</code> script.<br><br>If you have problems while building or want finer control over the building process, please read on.<br><h1>Prerequisites</h1>You should have <code>perl 5.6.1+</code>, <code>libreadline</code>, <code>libpcre</code>, <code>libssl</code> installed into your system. For Linux, you should also ensure that <code>ldconfig</code> is in your PATH environment.<br><h2>Debian and Ubuntu users</h2>You're recommended to install the following packages using apt-get:<br><pre>apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make
</pre><h2>Fedora and RedHat users</h2>You're recommended to install the following packages using yum:<br><pre>yum install readline-devel pcre-devel openssl-devel
</pre><h2>Mac OS X (Darwin) users</h2>You're recommended to install prerequisites PCRE using some package management tool, like <a target="_blank" title="External link to http://mxcl.github.com/homebrew/" href="http://mxcl.github.com/homebrew/" class="externalLink">Homebrew</a>:<br><pre>brew install pcre
</pre>Alternatively you can install PCRE from source all by yourself :)<br><br>After installing PCRE, you may need to specify the paths for PCRE's headers and libraries to your C compiler and linker, for example,<br><pre>$ ./configure \
--with-cc-opt="-I/usr/local/include" \
--with-ld-opt="-L/usr/local/lib" \
...
</pre>assuming that your PCRE is installed under the prefix <code>/usr/local/</code>.<br><br>See also <a target="_blank" title="External link to https://github.com/agentzh/ngx_openresty/issues/3" href="https://github.com/agentzh/ngx_openresty/issues/3" class="externalLink">Issue #3</a>.<br><br><h2>FreeBSD users</h2>You need to install the following ports:<br><ul><li> devel/gmake</li><li> security/openssl</li><li> devel/pcre</li></ul><h2>Solaris 11 users</h2>You need to install the following packages from the official repository:<br><ul><li> gcc-3</li><li> SUNWlibm</li></ul>Usually it's just as simple as<br><pre>pfexec pkg install gcc-3 SUNWlibm
</pre><h1>Build OpenResty</h1><h2>Download</h2>download the latest ngx_openresty tarball can be fetched from the <a tiddlylink="Download" refresh="link" target="_blank" title="External link to null#Download" href="null#Download" class="externalLink null">Download</a> page and unpack it like this:<br><pre>tar xzvf ngx_openresty-VERSION.tar.gz
</pre>where <code>VERSION</code> should be replaced by real version numbers like <code>0.8.54.6</code>.<br><h2>./configure</h2>Then enter the <code>ngx_openresty-VERSION/</code> directory, and type the following command to configure:<br><pre>./configure
</pre>By default, <code>--prefix=/usr/local/openresty</code> is assumed. You should only disable <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> 2 when your platform does not support <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a>.<br><br>You can specify various options, as in<br><pre>./configure --prefix=/opt/openresty \
--with-pcre-jit \
--with-ipv6 \
--without-http_redis2_module \
--with-http_iconv_module \
--with-http_postgres_module \
-j2
</pre>All of the standard Nginx configure file options can be used here, including <code>--add-module=PATH</code> for adding your own 3rd-party Nginx C modules. Try <code>./configure --help</code> to see more options available.<br><br>Errors in running the ./configure script can be found in the file <code>build/nginx-VERSION/objs/autoconf.err</code> where <code>VERSION</code> should be replaced by a concrete version number of <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>, like <code>0.8.54.6</code>.<br><h3>Notes for Solaris users</h3>For Solaris, it's common to install libraries like OpenSSL to <code>/lib</code>, so when it complaints about missing OpenSSL and you have indeed already installed it, specify the <code>--with-ld-opt='-L/lib'</code> option.<br><h2>make</h2>Now you can compile everything up using the command<br><pre>make
</pre>If your machine has multiple cores and your <code>make</code> supports the jobserver feature, you can compile things in parallel like this:<br><pre>make -j2
</pre>assuming you have 2 CPU cores.<br><h2>make install</h2>If all the previous steps go without problems, you can install <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> into your system by typing the command<br><pre>make install
</pre>On Linux, it often requires <code>sudo</code> to gain root access.<br></description>
<category>doc</category>
<category>install</category>
<link>null#Installation</link>
<pubDate>Thu, 24 Jul 2014 20:12:00 GMT</pubDate>
</item>
<item>
<title>BuildSystemtap</title>
<description><a tiddler="BuildSystemtap" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><pre>sudo yum install gcc gcc-c++ -y
cd /tmp/
wget https://fedorahosted.org/releases/e/l/elfutils/0.159/elfutils-0.159.tar.bz2
tar -xvf elfutils-0.159.tar.bz2
wget https://sourceware.org/systemtap/ftp/releases/systemtap-2.5.tar.gz
tar -xvf systemtap-2.5.tar.gz
cd systemtap-2.5/
./configure --prefix=/opt/stap --disable-docs \
--disable-publican --disable-refdocs CFLAGS="-g -O2" \
--with-elfutils=../elfutils-0.159
make -j8
sudo make install
</pre>And then invoke stap like this:<br><pre>$ /opt/stap/bin/stap -V
Systemtap translator/driver (version 2.5/0.158, non-git sources)
Copyright (C) 2005-2014 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBRPM LIBSQLITE3 NSS BOOST_SHARED_PTR TR1_UNORDERED_MAP NLS LIBXML2
</pre>Or you can just add the <code>/opt/stap/bin</code> path to your <code>PATH</code> environment.</description>
<link>null#BuildSystemtap</link>
<pubDate>Tue, 22 Jul 2014 20:30:00 GMT</pubDate>
</item>
<item>
<title>ChangeLog1007002</title>
<description><a tiddler="ChangeLog1007002" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><h1> Version 1.7.2.1 - 12 July 2014</h1><ul><li> upgraded the Nginx core to 1.7.2.<ul><li> see the changes here: <a target="_blank" title="External link to http://nginx.org/en/CHANGES" href="http://nginx.org/en/CHANGES" class="externalLink">http://nginx.org/en/CHANGES</a></li></ul></li><li> upgraded <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> to v2.1-20140707: <a target="_blank" title="External link to https://github.com/openresty/luajit2/tags" href="https://github.com/openresty/luajit2/tags" class="externalLink">https://github.com/openresty/luajit2/tags</a><ul><li> imported Mike Pall's latest bug fixes and other changes:<ul><li> feature: compile debug.getmetatable(). Thanks to Karel Tuma.</li><li> bugfix: Fix ABC elimination (for negative table indexes, for example).</li><li> bugfix: FFI: Fix compilation of reference field access.</li><li> bugfix: FFI: fixed frame traversal for backtraces with FFI callbacks.</li><li> bugfix: x86: lj_math_random_step() clobbers XMM regs on OSX Clang.</li><li> bugfix: fixed debug info for main chunk of stripped bytecode.</li></ul></li></ul></li><li> upgraded <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a> to 0.0.8.<ul><li> feature: <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycoreregex" href="https://github.com/openresty/lua-resty-core#restycoreregex" class="externalLink">resty.core.regex</a>: use <code>resty.lrucache</code> for the compiled regex cache for <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxrefind" href="https://github.com/openresty/lua-nginx-module#ngxrefind" class="externalLink">ngx.re.find</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxrematch" href="https://github.com/openresty/lua-nginx-module#ngxrematch" class="externalLink">ngx.re.match</a> in order to prevent pathalogical performance when the number of regexes has exceeded <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#lua_regex_cache_max_entries" href="https://github.com/openresty/lua-nginx-module/#lua_regex_cache_max_entries" class="externalLink">lua_regex_cache_max_entries</a>.</li><li> optimize: <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycoreregex" href="https://github.com/openresty/lua-resty-core#restycoreregex" class="externalLink">resty.core.regex</a>: removed one obsolete assertion that was for a <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> bug (already fixed).</li></ul></li><li> upgraded <a tiddlylink="LuaRestyDNSLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyDNSLibrary" href="null#LuaRestyDNSLibrary" class="externalLink null">LuaRestyDNSLibrary</a> to 0.12.<ul><li> feature: added support for the SRV resource record type (see <a target="_blank" title="External link to http://www.ietf.org/rfc/rfc2782.txt" href="http://www.ietf.org/rfc/rfc2782.txt" class="externalLink">RFC 2782</a>). thanks Torbjörn Norinder for the patch.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyUpstreamHealthcheckLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyUpstreamHealthcheckLibrary" href="null#LuaRestyUpstreamHealthcheckLibrary" class="externalLink null">LuaRestyUpstreamHealthcheckLibrary</a> to 0.02.<ul><li> bugfix: for bad status lines, we could throw out the "bad argument #2 to 'sub'" error, reported by George Bashi.</li><li> doc: avoided using the <code>\r\n</code> sequence in Lua long brackets because Lua would squeeze it to <code>\n</code>, unfortunately. thanks George Bashi for the report.</li><li> doc: made it clear that multiple <code>upstream {} </code> blocks' checkers can share a single shm zone. thanks Robert Paprocki for asking.</li><li> doc: now we need to turn off <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#lua_socket_log_errors" href="https://github.com/openresty/lua-nginx-module/#lua_socket_log_errors" class="externalLink">lua_socket_log_errors</a> explicitly in code examples.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyLrucacheLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyLrucacheLibrary" href="null#LuaRestyLrucacheLibrary" class="externalLink null">LuaRestyLrucacheLibrary</a> to 0.02.<ul><li> feature: added an alternative implementation using FFI-based hash-table in the form of the new class <code>resty.lrucache.pureffi</code>, which is much faster than the default <code>resty.lrucache</code> class when there are a lot of key variations. thanks Shuxin Yang for the patch.</li></ul></li><li> upgraded <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> to 0.9.10.<ul><li> feature: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxsockettcp" href="https://github.com/openresty/lua-nginx-module#ngxsockettcp" class="externalLink">stream-typed cosockets</a> are now full-duplex: a reader "<a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxthreadspawn" href="https://github.com/openresty/lua-nginx-module#ngxthreadspawn" class="externalLink">light thread</a>" and a writer "light thread" can operate on the same cosocket simultaneously. thanks shun zhang and aviramc for the original patches.</li><li> feature: added new API function <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxthreadkill" href="https://github.com/openresty/lua-nginx-module/#ngxthreadkill" class="externalLink">ngx.thread.kill()</a> for killing a user "light thread". thanks aviramc for the original patch.</li><li> bugfix: the "coroutine" module table introduced by <code>require('coroutine')</code> was not working in our Lua context. thanks Paul K and Pierre-Yves Gérardy for the report.</li><li> bugfix: fixed the initial size of the ngx.worker table and the misleading comment due to a copy&amp;paste mistake. thanks Suraj Jaiswal for the report.</li><li> bugfix: the "coctx cleanup" handler might not be called before being overidden by other operations. this could happen when failing to yield in an error handler (for <a target="_blank" title="External link to http://www.lua.org/manual/5.1/manual.html#pdf-xpcall" href="http://www.lua.org/manual/5.1/manual.html#pdf-xpcall" class="externalLink">xpcall</a>).</li><li> bugfix: fixed an incorrect error message. thanks doujiang for the patch.</li><li> bugfix: fixed a compilation error regression when using the Microsoft Visual C/C++ compiler. thanks itpp16 for the patch.</li><li> bugfix: we should use <code>c-&gt;buffered &amp; NGX_HTTP_LOWLEVEL_BUFFERED</code> instead of <code>c-&gt;buffered</code> for testing if the downstream connection is busy writing.</li><li> bugfix: we did not handle an out-of-memory case in <a target="_blank" title="External link to http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_data" href="http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_data" class="externalLink">ngx.req.set_body_data()</a>.</li><li> bugfix: ngx_http_lua_chain_get_free_buf(): avoided returning zero-sized memory bufs.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#body_filter_by_lua" href="https://github.com/openresty/lua-nginx-module#body_filter_by_lua" class="externalLink">body_filter_by_lua*</a>: we might incorrectly pass zero-size bufs (in the form of "special sync bufs") at the beginning of a chain, which could get stuck in the buffer of <code>ngx_http_writer_filter_module</code> (or in other words, being "busy") while could still get recycled in the content handler (like <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#content_by_lua" href="https://github.com/openresty/lua-nginx-module#content_by_lua" class="externalLink">content_by_lua</a>), leading to buffer corruptions. thanks westhood for the report and patch.</li><li> bugfix: we did not clear all the fields in the <code>ngx_buf_t</code> C struct when recycling chain link buffers.</li><li> bugfix: the <code>*_by_lua_file</code> directives failed to load .lua files of exactly the size <code>n*LUAL_BUFFERSIZE</code> bytes with the error "'end' expected (to close 'function' at line 1) near '&lt;eof&gt;'". thanks kworr for the report.</li><li> change: now we always iterate through all the user light threads to ensure all threads are de-anchored even when the "uthreads" counter gets out of sync. also added an assertion on the "uthreads" counter.</li><li> change: now we turn off our C-land assertions by default unless the user explicitly specifies the C compiler option <code>-DNGX_LUA_USE_ASSERT</code>.</li><li> change: throw out the "no memory" Lua error consistently (instead of "out of memory") when failing to allocate on the nginx side.</li><li> change: we now still call <code>ngx_pfree()</code> in our own <code>pcre_free</code> hook.</li><li> doc: documented the <code>NGX_LUA_USE_ASSERT</code> and <code>NGX_LUA_ABORT_AT_PANIC</code> C macros.</li><li> doc: added performance notes to the sections for the <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxvarvariable" href="https://github.com/openresty/lua-nginx-module#ngxvarvariable" class="externalLink">ngx.var</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxctx" href="https://github.com/openresty/lua-nginx-module#ngxctx" class="externalLink">ngx.ctx</a> API.</li><li> doc: documented the types of Lua values that can be passed to the <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxtimerat" href="https://github.com/openresty/lua-nginx-module#ngxtimerat" class="externalLink">ngx.timer</a> callback functions.</li></ul></li><li> upgraded <a tiddlylink="FormInputNginxModule" refresh="link" target="_blank" title="External link to null#FormInputNginxModule" href="null#FormInputNginxModule" class="externalLink null">FormInputNginxModule</a> to 0.09.<ul><li> bugfix: fixed warnings from the Microsoft Visual C/C++ compiler. thanks itpp16 for the report.</li></ul></li><li> upgraded <a tiddlylink="EchoNginxModule" refresh="link" target="_blank" title="External link to null#EchoNginxModule" href="null#EchoNginxModule" class="externalLink null">EchoNginxModule</a> to 0.54.<ul><li> bugfix: the "unknown option for echo_subrequest_async" error was thrown when Nginx variables were used in both the "method" argument and URI argument of the <a target="_blank" title="External link to https://github.com/openresty/echo-nginx-module#echo_subrequest" href="https://github.com/openresty/echo-nginx-module#echo_subrequest" class="externalLink">echo_subrequest</a> directive (and etc). thanks Utkarsh Upadhyay for the report.</li><li> bugfix: fixed a misleading error message.</li></ul></li><li> upgraded <a tiddlylink="SrcacheNginxModule" refresh="link" target="_blank" title="External link to null#SrcacheNginxModule" href="null#SrcacheNginxModule" class="externalLink null">SrcacheNginxModule</a> to 0.28.<ul><li> feature: log an error message when <a target="_blank" title="External link to http://wiki.nginx.org/HttpSRCacheModule#srcache_store" href="http://wiki.nginx.org/HttpSRCacheModule#srcache_store" class="externalLink">srcache_store</a> subrequest has an error or returns a bad HTTP status code. thanks Yann Coleu for the report.</li><li> doc: typo fix from javasboy.</li></ul></li><li> upgraded <a tiddlylink="MemcNginxModule" refresh="link" target="_blank" title="External link to null#MemcNginxModule" href="null#MemcNginxModule" class="externalLink null">MemcNginxModule</a> to 0.15.<ul><li> bugfix: we did not log error messages for invalid values of <code>$memc_flags</code>, <code>$memc_exptime</code>, and <code>$memc_value</code>, leading to hard-to-debug HTTP 400 status errors. thanks Yann Coleu for the report.</li></ul></li><li> bugfix: <code>./configure --without-lua_resty_dns</code> did not work as declared. thanks Vitaly for the report.</li><li> bugfix: use <code>cc</code> as the default C compiler for <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> and Lua C libraries because modern FreeBSD 10 has no gcc by default and its clang is already featureful enough to compile everything. thanks Stefan Parvu for the suggestion.</li><li> change: <code>./configure --with-debug</code> now also passes the extra C compiler options <code>-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC</code> to the <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> build.</li></ul>See <a tiddlylink="ChangeLog1007000" refresh="link" target="_blank" title="External link to null#ChangeLog1007000" href="null#ChangeLog1007000" class="externalLink null">ChangeLog1007000</a> for change log for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> 1.7.0.x.</description>
<link>null#ChangeLog1007002</link>
<pubDate>Sun, 13 Jul 2014 03:24:00 GMT</pubDate>
</item>
<item>
<title>ChangeLog1007000</title>
<description><a tiddler="ChangeLog1007000" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><h1> Version 1.7.0.1 - 7 June 2014</h1><ul><li> upgraded the Nginx core to 1.7.0.<ul><li> see the changes here: <a target="_blank" title="External link to http://nginx.org/en/CHANGES" href="http://nginx.org/en/CHANGES" class="externalLink">http://nginx.org/en/CHANGES</a></li></ul></li><li> feature: bundled new Lua library, <a tiddlylink="LuaRestyLrucacheLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyLrucacheLibrary" href="null#LuaRestyLrucacheLibrary" class="externalLink null">LuaRestyLrucacheLibrary</a>, which is also enabled by default. see <a target="_blank" title="External link to https://github.com/openresty/lua-resty-lrucache#readme" href="https://github.com/openresty/lua-resty-lrucache#readme" class="externalLink">https://github.com/openresty/lua-resty-lrucache#readme</a> for more details. thanks Shuxin Yang for the help.</li><li> upgraded <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> to v2.1-20140607: <a target="_blank" title="External link to https://github.com/openresty/luajit2/tags" href="https://github.com/openresty/luajit2/tags" class="externalLink">https://github.com/openresty/luajit2/tags</a><ul><li> imported Mike Pall's latest bug fixes and other changes:<ul><li> Fix frame traversal while searching for error function.</li><li> Fix FOLD rule for STRREF of SNEW.</li><li> FFI: Fix recording of indexing a struct pointer ctype object itself.</li><li> FFI: Another fix for cdata equality comparisons.</li><li> Fix FOLD rule for <code>string.sub(s, ...) == k</code>.</li><li> x86: Fix code generation for unused result of <code>math.random()</code>.</li><li> x64: Workaround for MSVC build issue.</li><li> PPC: Fix red zone overflow in machine code generation.</li><li> Fix compatibility issues with Illumos. Thanks to Theo Schlossnagle.</li><li> Add PS Vita port. Thanks to Anton Stenmark.</li></ul></li><li> disabled trace stitching by default for now since it may trigger random lua stack corruptions when using with ngx_lua.</li><li> feature: jit.dump: output Lua source location after every BC.</li><li> feature: added internal memory-buffer-based trace entry/exit/start-recording event logging, mainly for debugging bugs in the JIT compiler. it requires <code>-DLUA_USE_TRACE_LOGS</code> when building.</li><li> feature: save <code>g-&gt;jit_base</code> to <code>g-&gt;saved_jit_base</code> before <code>lj_err_throw</code> clears <code>g-&gt;jit_base</code> which makes it impossible to get Lua backtrace in such states.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a> to 0.0.7.<ul><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxreqset_header" href="https://github.com/openresty/lua-nginx-module/#ngxreqset_header" class="externalLink">ngx.req.set_header()</a> (partial: table-typed values not yet supported) and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxreqclear_header" href="https://github.com/openresty/lua-nginx-module/#ngxreqclear_header" class="externalLink">ngx.req.clear_header()</a> with FFI in the <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycorerequest" href="https://github.com/openresty/lua-resty-core#restycorerequest" class="externalLink">resty.core.request</a> module.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxshareddictflush_all" href="https://github.com/openresty/lua-nginx-module/#ngxshareddictflush_all" class="externalLink">shdict:flush_all()</a> with FFI in the <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycoreshdict" href="https://github.com/openresty/lua-resty-core#restycoreshdict" class="externalLink">resty.core.shdict</a>.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxreqset_method" href="https://github.com/openresty/lua-nginx-module/#ngxreqset_method" class="externalLink">ngx.req.set_method()</a> with FFI in <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycorerequest" href="https://github.com/openresty/lua-resty-core#restycorerequest" class="externalLink">resty.core.request</a>.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxreqget_method" href="https://github.com/openresty/lua-nginx-module/#ngxreqget_method" class="externalLink">ngx.req.get_method()</a> with FFI in <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycorerequest" href="https://github.com/openresty/lua-resty-core#restycorerequest" class="externalLink">resty.core.request</a>.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxtime" href="https://github.com/openresty/lua-nginx-module/#ngxtime" class="externalLink">ngx.time()</a> with FFI in <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycoretime" href="https://github.com/openresty/lua-resty-core#restycoretime" class="externalLink">resty.core.time</a>.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxreqstart_time" href="https://github.com/openresty/lua-nginx-module/#ngxreqstart_time" class="externalLink">ngx.req.start_time</a> with FFI in <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycorerequest" href="https://github.com/openresty/lua-resty-core#restycorerequest" class="externalLink">rest.core.request</a>.</li><li> feature: implemented <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxnow" href="https://github.com/openresty/lua-nginx-module/#ngxnow" class="externalLink">ngx.now()</a> with FFI in <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core#restycoretime" href="https://github.com/openresty/lua-resty-core#restycoretime" class="externalLink">resty.core.time</a>.</li></ul></li><li> upgraded <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> to 0.9.8.<ul><li> bugfix: the <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxctx" href="https://github.com/openresty/lua-nginx-module/#ngxctx" class="externalLink">ngx.ctx</a> table might be released prematurely when <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxexit" href="https://github.com/openresty/lua-nginx-module/#ngxexit" class="externalLink">ngx.exit()</a> was used to generate the response header. thanks Monkey Zhang for the report. now we always release <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxctx" href="https://github.com/openresty/lua-nginx-module/#ngxctx" class="externalLink">ngx.ctx</a> in our request pool cleanup handler.</li><li> bugfix: we did not call our coroutine cleanup handlers right after our coroutine completes (either successfully or unsuccessfully) otherwise segmentation fault might happen when the Lua VM throws out unexpected exceptions like "attempt to yield across C-call boundary". thanks Lipin Dmitriy for the report.</li><li> bugfix: nginx does not guarentee the parent pointer of the rbtree root is meaningful, which could lead to inifinite loops when <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> tried to abort pending timers prematurely (upon worker exit). thanks pengqi for the report.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxreqset_method" href="https://github.com/openresty/lua-nginx-module/#ngxreqset_method" class="externalLink">ngx.req.set_method()</a>: we incorrectly modified <code>r-&gt;method</code> when the method ID was wrong.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#rewrite_by_lua" href="https://github.com/openresty/lua-nginx-module/#rewrite_by_lua" class="externalLink">rewrite_by_lua*</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#access_by_lua" href="https://github.com/openresty/lua-nginx-module/#access_by_lua" class="externalLink">access_by_lua*</a> will now terminate the current request if the response header has already been sent (via calls like <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxsay" href="https://github.com/openresty/lua-nginx-module/#ngxsay" class="externalLink">ngx.say</a> and <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#ngxsend_headers" href="https://github.com/openresty/lua-nginx-module/#ngxsend_headers" class="externalLink">ngx.send_headers</a>) at that point. thanks yaronli and Sophos for the report.</li><li> bugfix: issues in the error handling for pure C API functions for shared dict. thanks Xiaochen Wang.</li><li> feature: now we save the original pattern string pointer value into our <code>ngx_http_lua_regex_t</code> C struct, to help runtime regex profiling and debugging.</li><li> feature: allow use of 3rd-party pcre bindings in <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module/#init_by_lua" href="https://github.com/openresty/lua-nginx-module/#init_by_lua" class="externalLink">init_by_lua*</a>. thanks ikokostya for the feature request.</li><li> feature: added pure C API functions to support the new FFI-based Lua API implemented in <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a>.</li><li> feature: make use of the new shm API in nginx 1.5.13+ to suppress the "no memory" error logging when the shared dictionaries run out of memory.</li><li> feature: added C macro <code>NGX_LUA_ABORT_AT_PANIC</code> to allow generating a core dump when the Lua VM panics.</li></ul></li><li> upgraded <a tiddlylink="SrcacheNginxModule" refresh="link" target="_blank" title="External link to null#SrcacheNginxModule" href="null#SrcacheNginxModule" class="externalLink null">SrcacheNginxModule</a> to 0.27.<ul><li> bugfix: we used to skip all the output header and body filters run before our filters (which unfortunately bypassed the standard ngx_http_not_modified_filter_module, for example). thanks Lloyd Zhou for the report.</li><li> feature: added new config directive <a target="_blank" title="External link to https://github.com/openresty/srcache-nginx-module#srcache_store_ranges" href="https://github.com/openresty/srcache-nginx-module#srcache_store_ranges" class="externalLink">srcache_store_ranges</a> for storing 206 Partial Content responses generated by the standard ngx_http_range_filter_module.</li></ul></li><li> bugfix: updated the dtrace patch because systemtap 2.5 no longer accepts the <code>-xnolib</code> option in its dtrace utility.</li><li> removed our bundled version of <code>ngx_http_auth_request_module</code> because recent versions of the nginx core already have it. thanks LazyZhu for the report.</li><li> bugfix: applied our patch for the nginx core to fix the long standing memory fragmentation issue for blocks larger than the page size in the nginx slab allocator: <a target="_blank" title="External link to http://mailman.nginx.org/pipermail/nginx-devel/2014-May/005316.html" href="http://mailman.nginx.org/pipermail/nginx-devel/2014-May/005316.html" class="externalLink">http://mailman.nginx.org/pipermail/nginx-devel/2014-May/005316.html</a> thanks Shuxin Yang for the help.</li></ul>See <a tiddlylink="ChangeLog1005012" refresh="link" target="_blank" title="External link to null#ChangeLog1005012" href="null#ChangeLog1005012" class="externalLink null">ChangeLog1005012</a> for change log for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> 1.5.12.x.</description>
<link>null#ChangeLog1007000</link>
<pubDate>Sat, 07 Jun 2014 20:52:00 GMT</pubDate>
</item>
<item>
<title>Components</title>
<description><a tiddler="Components" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>Below lists all the components bundled in <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>. All of the components can be enabled or disabled on need.<br><br>Most of the components are enabled by default, some are not.<br><br>The standard Lua 5.1 interpreter, <a tiddlylink="DrizzleNginxModule" refresh="link" target="_blank" title="External link to null#DrizzleNginxModule" href="null#DrizzleNginxModule" class="externalLink null">DrizzleNginxModule</a>, <a tiddlylink="PostgresNginxModule" refresh="link" target="_blank" title="External link to null#PostgresNginxModule" href="null#PostgresNginxModule" class="externalLink null">PostgresNginxModule</a>, and <a tiddlylink="IconvNginxModule" refresh="link" target="_blank" title="External link to null#IconvNginxModule" href="null#IconvNginxModule" class="externalLink null">IconvNginxModule</a> are not enabled by default. You need to specify the <code>--with-lua51</code>, <code>--with-http_drizzle_module</code>, <code>--with-http_postgres_module</code>, and <code>--with-http_iconv_module</code> options, respectively, to enable them while <a tiddlylink="Installation" refresh="link" target="_blank" title="External link to null#Installation" href="null#Installation" class="externalLink null">building OpenResty</a>.<br><br>Before the 1.5.8.1 release, the standard Lua 5.1 interpreter is enabled by default while <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> 2.x is not. So for earlier releases, you need to explicitly specify the <code>--with-luajit</code> option (which is the default for 1.5.8.1+) to use <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> 2.x.<br><br><ul><li> <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a></li><li> <a tiddlylink="ArrayVarNginxModule" refresh="link" target="_blank" title="External link to null#ArrayVarNginxModule" href="null#ArrayVarNginxModule" class="externalLink null">ArrayVarNginxModule</a></li><li> <a tiddlylink="AuthRequestNginxModule" refresh="link" target="_blank" title="External link to null#AuthRequestNginxModule" href="null#AuthRequestNginxModule" class="externalLink null">AuthRequestNginxModule</a></li><li> <a tiddlylink="CoolkitNginxModule" refresh="link" target="_blank" title="External link to null#CoolkitNginxModule" href="null#CoolkitNginxModule" class="externalLink null">CoolkitNginxModule</a></li><li> <a tiddlylink="DrizzleNginxModule" refresh="link" target="_blank" title="External link to null#DrizzleNginxModule" href="null#DrizzleNginxModule" class="externalLink null">DrizzleNginxModule</a></li><li> <a tiddlylink="EchoNginxModule" refresh="link" target="_blank" title="External link to null#EchoNginxModule" href="null#EchoNginxModule" class="externalLink null">EchoNginxModule</a></li><li> <a tiddlylink="EncryptedSessionNginxModule" refresh="link" target="_blank" title="External link to null#EncryptedSessionNginxModule" href="null#EncryptedSessionNginxModule" class="externalLink null">EncryptedSessionNginxModule</a></li><li> <a tiddlylink="FormInputNginxModule" refresh="link" target="_blank" title="External link to null#FormInputNginxModule" href="null#FormInputNginxModule" class="externalLink null">FormInputNginxModule</a></li><li> <a tiddlylink="HeadersMoreNginxModule" refresh="link" target="_blank" title="External link to null#HeadersMoreNginxModule" href="null#HeadersMoreNginxModule" class="externalLink null">HeadersMoreNginxModule</a></li><li> <a tiddlylink="IconvNginxModule" refresh="link" target="_blank" title="External link to null#IconvNginxModule" href="null#IconvNginxModule" class="externalLink null">IconvNginxModule</a></li><li> <a tiddlylink="StandardLuaInterpreter" refresh="link" target="_blank" title="External link to null#StandardLuaInterpreter" href="null#StandardLuaInterpreter" class="externalLink null">StandardLuaInterpreter</a></li><li> <a tiddlylink="MemcNginxModule" refresh="link" target="_blank" title="External link to null#MemcNginxModule" href="null#MemcNginxModule" class="externalLink null">MemcNginxModule</a></li><li> <a tiddlylink="Nginx" refresh="link" target="_blank" title="External link to null#Nginx" href="null#Nginx" class="externalLink null">Nginx</a></li><li> <a tiddlylink="NginxDevelKit" refresh="link" target="_blank" title="External link to null#NginxDevelKit" href="null#NginxDevelKit" class="externalLink null">NginxDevelKit</a></li><li> <a tiddlylink="LuaCjsonLibrary" refresh="link" target="_blank" title="External link to null#LuaCjsonLibrary" href="null#LuaCjsonLibrary" class="externalLink null">LuaCjsonLibrary</a></li><li> <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a></li><li> <a tiddlylink="LuaRdsParserLibrary" refresh="link" target="_blank" title="External link to null#LuaRdsParserLibrary" href="null#LuaRdsParserLibrary" class="externalLink null">LuaRdsParserLibrary</a></li><li> <a tiddlylink="LuaRedisParserLibrary" refresh="link" target="_blank" title="External link to null#LuaRedisParserLibrary" href="null#LuaRedisParserLibrary" class="externalLink null">LuaRedisParserLibrary</a></li><li> <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a></li><li> <a tiddlylink="LuaRestyDNSLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyDNSLibrary" href="null#LuaRestyDNSLibrary" class="externalLink null">LuaRestyDNSLibrary</a></li><li> <a tiddlylink="LuaRestyLockLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyLockLibrary" href="null#LuaRestyLockLibrary" class="externalLink null">LuaRestyLockLibrary</a></li><li> <a tiddlylink="LuaRestyLrucacheLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyLrucacheLibrary" href="null#LuaRestyLrucacheLibrary" class="externalLink null">LuaRestyLrucacheLibrary</a></li><li> <a tiddlylink="LuaRestyMemcachedLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyMemcachedLibrary" href="null#LuaRestyMemcachedLibrary" class="externalLink null">LuaRestyMemcachedLibrary</a></li><li> <a tiddlylink="LuaRestyMySQLLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyMySQLLibrary" href="null#LuaRestyMySQLLibrary" class="externalLink null">LuaRestyMySQLLibrary</a></li><li> <a tiddlylink="LuaRestyRedisLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyRedisLibrary" href="null#LuaRestyRedisLibrary" class="externalLink null">LuaRestyRedisLibrary</a></li><li> <a tiddlylink="LuaRestyStringLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyStringLibrary" href="null#LuaRestyStringLibrary" class="externalLink null">LuaRestyStringLibrary</a></li><li> <a tiddlylink="LuaRestyUploadLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyUploadLibrary" href="null#LuaRestyUploadLibrary" class="externalLink null">LuaRestyUploadLibrary</a></li><li> <a tiddlylink="LuaRestyUpstreamHealthcheckLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyUpstreamHealthcheckLibrary" href="null#LuaRestyUpstreamHealthcheckLibrary" class="externalLink null">LuaRestyUpstreamHealthcheckLibrary</a></li><li> <a tiddlylink="LuaRestyWebSocketLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyWebSocketLibrary" href="null#LuaRestyWebSocketLibrary" class="externalLink null">LuaRestyWebSocketLibrary</a></li><li> <a tiddlylink="LuaUpstreamNginxModule" refresh="link" target="_blank" title="External link to null#LuaUpstreamNginxModule" href="null#LuaUpstreamNginxModule" class="externalLink null">LuaUpstreamNginxModule</a></li><li> <a tiddlylink="PostgresNginxModule" refresh="link" target="_blank" title="External link to null#PostgresNginxModule" href="null#PostgresNginxModule" class="externalLink null">PostgresNginxModule</a></li><li> <a tiddlylink="RdsCsvNginxModule" refresh="link" target="_blank" title="External link to null#RdsCsvNginxModule" href="null#RdsCsvNginxModule" class="externalLink null">RdsCsvNginxModule</a></li><li> <a tiddlylink="RdsJsonNginxModule" refresh="link" target="_blank" title="External link to null#RdsJsonNginxModule" href="null#RdsJsonNginxModule" class="externalLink null">RdsJsonNginxModule</a></li><li> <a tiddlylink="RedisNginxModule" refresh="link" target="_blank" title="External link to null#RedisNginxModule" href="null#RedisNginxModule" class="externalLink null">RedisNginxModule</a></li><li> <a tiddlylink="Redis2NginxModule" refresh="link" target="_blank" title="External link to null#Redis2NginxModule" href="null#Redis2NginxModule" class="externalLink null">Redis2NginxModule</a></li><li> <a tiddlylink="SetMiscNginxModule" refresh="link" target="_blank" title="External link to null#SetMiscNginxModule" href="null#SetMiscNginxModule" class="externalLink null">SetMiscNginxModule</a></li><li> <a tiddlylink="SrcacheNginxModule" refresh="link" target="_blank" title="External link to null#SrcacheNginxModule" href="null#SrcacheNginxModule" class="externalLink null">SrcacheNginxModule</a></li><li> <a tiddlylink="XssNginxModule" refresh="link" target="_blank" title="External link to null#XssNginxModule" href="null#XssNginxModule" class="externalLink null">XssNginxModule</a></li></ul></description>
<link>null#Components</link>
<pubDate>Sun, 01 Jun 2014 05:56:00 GMT</pubDate>
</item>
<item>
<title>LuaRestyCoreLibrary</title>
<description><a tiddler="LuaRestyCoreLibrary" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>Reimplements the Lua API provided by <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> with <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> FFI.<br><br>Project homepage: <a target="_blank" title="External link to https://github.com/openresty/lua-resty-core" href="https://github.com/openresty/lua-resty-core" class="externalLink">https://github.com/openresty/lua-resty-core</a><br><br>This library is enabled by default. You can specify the <code>--without-lua_resty_core</code> option to <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>'s <code>./configure</code> script to explicitly disable it.</description>
<link>null#LuaRestyCoreLibrary</link>
<pubDate>Sun, 01 Jun 2014 05:55:00 GMT</pubDate>
</item>
<item>
<title>LuaRestyLrucacheLibrary</title>
<description><a tiddler="LuaRestyLrucacheLibrary" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>Implements a Lua-land LRU cache for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>.<br><br>Project homepage: <a target="_blank" title="External link to https://github.com/openresty/lua-resty-lrucache" href="https://github.com/openresty/lua-resty-lrucache" class="externalLink">https://github.com/openresty/lua-resty-lrucache</a><br><br>This library is enabled by default. You can specify the <code>--without-lua_resty_lrucache</code> option to <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>'s <code>./configure</code> script to explicitly disable it.</description>
<link>null#LuaRestyLrucacheLibrary</link>
<pubDate>Sun, 01 Jun 2014 05:55:00 GMT</pubDate>
</item>
<item>
<title>ChangeLog1005012</title>
<description><a tiddler="ChangeLog1005012" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><h1> Version 1.5.12.1 - 29 April 2014</h1><ul><li> upgraded the Nginx core to 1.5.12.<ul><li> see the changes here: <a target="_blank" title="External link to http://nginx.org/en/CHANGES" href="http://nginx.org/en/CHANGES" class="externalLink">http://nginx.org/en/CHANGES</a></li></ul></li><li> upgraded <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> to v2.1-20140423 (see <a target="_blank" title="External link to https://github.com/openresty/luajit2/releases" href="https://github.com/openresty/luajit2/releases" class="externalLink">https://github.com/openresty/luajit2/releases</a> ).<ul><li> bugfix: prevent adding side traces for stack checks. (Mike pall) this could cause internal assertion failure in the JIT compiler while replaying snapshots in very obscure cases: <code>lj_snap.c:497: lj_snap_replay: Assertion `ir-&gt;o == IR_CONV &amp;&amp; ir-&gt;op2 == ((IRT_NUM&lt;&lt;5)|IRT_INT)' failed.</code></li><li> bugfix: fixed FOLD of string concatenations. (Mike Pall) this issue was reported by leafo and could lead to invalid string results in special cases while compiling string concatenations.</li><li> bugfix: FFI: fixed cdata equality comparison against strings and other Lua types. (Mike Pall)</li><li> bugfix: fixed top slot calculation for snapshots with continuations. (Mike Pall) this was a bug in snapshot generation, but it only surfaced with trace stitching. it could cause Lua stack overwrites in special cases.</li><li> bugfix: PPC: don't use mcrxr on PPE. (Mike Pall)</li><li> bugfix: prevent GC estimate miscalculation due to buffer growth. (Mike Pall)</li><li> bugfix: fixed the regression introduced by the previous fix for "reuse of SCEV results in FORL". (Mike Pall) this could cause internal assertion failure in the JIT compiler: <code>lj_record.c:68: rec_check_ir: Assertion `op2 &gt;= nk' failed.</code></li><li> bugfix: fixed alias analysis for <code>table.len</code> vs. <code>table.clear</code>. (Mike Pall) this could cause <code>table.len</code> to return incorrect values (nonzero values) after <code>table.clear</code> was performed.</li><li> bugfix: fixed the compatibility with DragonFlyBSD. thanks lhmwzy for the patch.</li><li> feature: allow non-scalar cdata to be compared for equality by address. (Mike Pall)</li></ul></li><li> upgraded <a tiddlylink="LuaUpstreamNginxModule" refresh="link" target="_blank" title="External link to null#LuaUpstreamNginxModule" href="null#LuaUpstreamNginxModule" class="externalLink null">LuaUpstreamNginxModule</a> to 0.02.<ul><li> bugfix: upstream names did not support taking a port number. thanks magicleo for the report.</li></ul></li><li> upgraded <a tiddlylink="Redis2NginxModule" refresh="link" target="_blank" title="External link to null#Redis2NginxModule" href="null#Redis2NginxModule" class="externalLink null">Redis2NginxModule</a> to 0.11.<ul><li> change: now we always ignore client aborts for collaborations with other modules like <a tiddlylink="SrcacheNginxModule" refresh="link" target="_blank" title="External link to null#SrcacheNginxModule" href="null#SrcacheNginxModule" class="externalLink null">SrcacheNginxModule</a>. thanks akamatgi for the report.</li></ul></li><li> upgraded <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> to 0.9.7.<ul><li> bugfix: when <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#lua_code_cache" href="https://github.com/openresty/lua-nginx-module#lua_code_cache" class="externalLink">lua_code_cache</a> was off, <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive" href="https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive" class="externalLink">cosocket:setkeepalive()</a> might lead to segmentation faults. thanks Kelvin Peng for the report.</li><li> refactor: improved the error handling and logging in the Lua code loader and closure factory.</li><li> change: added stronger assertions to the stream-typed cosocket implementation.</li><li> optimize: we no longer call <code>ngx_pfree()</code> in our own <code>pcre_free</code> hook.</li><li> optimize: we no longer clear the pointer <code>ctx-&gt;user_co_ctx</code> in <code>ngx_http_lua_reset_ctx</code>.</li></ul></li><li> upgraded <a tiddlylink="EchoNginxModule" refresh="link" target="_blank" title="External link to null#EchoNginxModule" href="null#EchoNginxModule" class="externalLink null">EchoNginxModule</a> to 0.53.<ul><li> bugfix: use of empty arguments after the <code>-n</code> option of the <a target="_blank" title="External link to https://github.com/openresty/echo-nginx-module#echo" href="https://github.com/openresty/echo-nginx-module#echo" class="externalLink">echo</a> directive (and its friends) might cause subsequent arguments to get discarded. thanks Lice Pan for the report and fix.</li></ul></li><li> upgraded <a tiddlylink="FormInputNginxModule" refresh="link" target="_blank" title="External link to null#FormInputNginxModule" href="null#FormInputNginxModule" class="externalLink null">FormInputNginxModule</a> to 0.08.<ul><li> bugfix: segmentation fault might happen when <code>set_form_input_multi</code> was used while no proper <code>Content-Type</code> request header was given.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyWebSocketLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyWebSocketLibrary" href="null#LuaRestyWebSocketLibrary" class="externalLink null">LuaRestyWebSocketLibrary</a> to 0.03.<ul><li> optimize: added a minor optimization in the <a target="_blank" title="External link to https://github.com/openresty/lua-resty-websocket#recv_frame" href="https://github.com/openresty/lua-resty-websocket#recv_frame" class="externalLink">recv_frame()</a> method. thanks yurnerola for the catch.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a> to 0.0.6.<ul><li> optimize: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxresub" href="https://github.com/openresty/lua-nginx-module#ngxresub" class="externalLink">ngx.re.sub</a>/<a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxregsub" href="https://github.com/openresty/lua-nginx-module#ngxregsub" class="externalLink">ngx.re.gsub</a>: now we avoid constructing new Lua strings for the regex cache keys, which gives 5% speedup for trivial use cases.</li><li> optimize: <a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxrematch" href="https://github.com/openresty/lua-nginx-module#ngxrematch" class="externalLink">ngx.re.match</a>/<a target="_blank" title="External link to https://github.com/openresty/lua-nginx-module#ngxrefind" href="https://github.com/openresty/lua-nginx-module#ngxrefind" class="externalLink">ngx.re.find</a>: avoided constructing a new Lua string for the regex cache key by switching over to a cascaded 2-level hash table, which gives 22% speedup for simple use cases.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyLockLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyLockLibrary" href="null#LuaRestyLockLibrary" class="externalLink null">LuaRestyLockLibrary</a> to 0.03.<ul><li> bugfix: prevented using cdata directly as table keys.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyStringLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyStringLibrary" href="null#LuaRestyStringLibrary" class="externalLink null">LuaRestyStringLibrary</a> to 0.09.<ul><li> bugfix: avoided using the "module" builtin function to define lua modules. thanks lhmwzy for the original patch.</li></ul></li></ul>See <a tiddlylink="ChangeLog1005011" refresh="link" target="_blank" title="External link to null#ChangeLog1005011" href="null#ChangeLog1005011" class="externalLink null">ChangeLog1005011</a> for change log for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> 1.5.11.x.</description>
<link>null#ChangeLog1005012</link>
<pubDate>Sun, 01 Jun 2014 05:53:00 GMT</pubDate>
</item>
<item>
<title>ChangeLog1005011</title>
<description><a tiddler="ChangeLog1005011" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><h1> Version 1.5.11.1 - 30 March 2014</h1><ul><li> upgraded <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> to v2.1-20140330.<ul><li> feature: included Mike Pall's new "trace stitching" feature that can compile around most of the <a target="_blank" title="External link to http://wiki.luajit.org/NYI" href="http://wiki.luajit.org/NYI" class="externalLink">NYI items</a>. thanks <a target="_blank" title="External link to http://www.cloudflare.com/" href="http://www.cloudflare.com/" class="externalLink">CloudFlare Inc.</a> for sponsoring the development. This helps compiling more Lua code. For example, it gives 10% ~ 40% speedup in simple test cases of <a tiddlylink="LuaRestyMySQLLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyMySQLLibrary" href="null#LuaRestyMySQLLibrary" class="externalLink null">LuaRestyMySQLLibrary</a> out of the box.</li><li> bugfix: included all the new bug fixes from Mike Pall, most of which are very obscure bugs in the JIT compiler hidden for years.</li><li> relaxed the hard-coded heuristic limit further to 100 for loopunroll.</li><li> feature: applied John Marino's patch for compiling <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a> on DragonFlyBSD. thanks lhmwzy for proposing the patch.</li></ul></li><li> upgraded the Nginx core to 1.5.11.<ul><li> see the changes here: <a target="_blank" title="External link to http://nginx.org/en/CHANGES" href="http://nginx.org/en/CHANGES" class="externalLink">http://nginx.org/en/CHANGES</a></li></ul></li><li> bugfix: applied the patch to the NGINX core for the latest SPDY security vulnerability (CVE-2014-0133).</li><li> feature: added support for DragonFlyBSD to <code>./configure</code>. thanks lhmwzy for the patch.</li><li> bugfix: disabled the -Werror option for clang because it caused build failures at least in recent Mac OS X systems. thanks Hamish Forbes for the report.</li><li> feature: bundled new component <a tiddlylink="LuaRestyUpstreamHealthcheckLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyUpstreamHealthcheckLibrary" href="null#LuaRestyUpstreamHealthcheckLibrary" class="externalLink null">LuaRestyUpstreamHealthcheckLibrary</a> 0.01.<ul><li> see the documentation for details: <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-upstream-healthcheck#readme" href="https://github.com/agentzh/lua-resty-upstream-healthcheck#readme" class="externalLink">https://github.com/agentzh/lua-resty-upstream-healthcheck#readme</a></li></ul></li><li> feature: bundled new component <a tiddlylink="LuaUpstreamNginxModule" refresh="link" target="_blank" title="External link to null#LuaUpstreamNginxModule" href="null#LuaUpstreamNginxModule" class="externalLink null">LuaUpstreamNginxModule</a> 0.01.<ul><li> see the documentation for details: <a target="_blank" title="External link to https://github.com/agentzh/lua-upstream-nginx-module#readme" href="https://github.com/agentzh/lua-upstream-nginx-module#readme" class="externalLink">https://github.com/agentzh/lua-upstream-nginx-module#readme</a></li></ul></li><li> upgraded <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> to 0.9.6.<ul><li> feature: added new configuration directives, <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#init_worker_by_lua" href="https://github.com/chaoslawful/lua-nginx-module/#init_worker_by_lua" class="externalLink">init_worker_by_lua</a> and <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#init_worker_by_lua_file" href="https://github.com/chaoslawful/lua-nginx-module/#init_worker_by_lua_file" class="externalLink">init_worker_by_lua_file</a>, to run Lua code upon every nginx worker process's startup.</li><li> feature: added new API function <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxconfignginx_configure" href="https://github.com/chaoslawful/lua-nginx-module/#ngxconfignginx_configure" class="externalLink">ngx.config.nginx_configure()</a> to return the NGINX <code>./configure</code> arguments string to the Lua land. thanks Tatsuhiko Kubo for the patch.</li><li> feature: added new API function <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxrespget_headers" href="https://github.com/chaoslawful/lua-nginx-module/#ngxrespget_headers" class="externalLink">ngx.resp.get_headers()</a> for fetching all the response headers. thanks Tatsuhiko Kubo for the patch.</li><li> feature: added new API function <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxworkerpid" href="https://github.com/chaoslawful/lua-nginx-module/#ngxworkerpid" class="externalLink">ngx.worker.pid()</a> for retrieving the current nginx worker process's pid.</li><li> feature: explicitly check Lua langauge version mismatch; we only accept the Lua 5.1 language (for now).</li><li> bugfix: accessing a cosocket object from a request which does not create it could lead to segmentation faults. now we throw out a Lua error "bad request" properly in this case.</li><li> change: it is now the user's responsibility to clear the captures table for <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxrematch" href="https://github.com/chaoslawful/lua-nginx-module/#ngxrematch" class="externalLink">ngx.re.match()</a>.</li><li> bugfix: we should prefix our chunk names for from-string lua source (which also leads to nicer error messages). thanks Mike Pall for the catch.</li><li> bugfix: subrequests initiated by <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxlocationcapture" href="https://github.com/chaoslawful/lua-nginx-module/#ngxlocationcapture" class="externalLink">ngx.location.capture*</a> with the HEAD method did not result in responses without response bodies. thanks Daniel for the report.</li><li> bugfix: segfault might happen in the FFI API for destroying compiled PCRE regexes, which affects libraries like <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a>. thanks Dane Kneche.</li><li> bugfix: fixes for small string buffer arguments in the C API for FFI-based implementations of <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxshareddictget" href="https://github.com/chaoslawful/lua-nginx-module/#ngxshareddictget" class="externalLink">shdict:get()</a>.</li><li> bugfix: fixed the error message buffer overwrite in the C API for FFI-based <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxrematch" href="https://github.com/chaoslawful/lua-nginx-module/#ngxrematch" class="externalLink">ngx.re</a> implementations.</li><li> bugfix: use of the public C API in other nginx C modules (extending <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a>) lead to compilation errors and warnings when the Microsoft C compiler is used. thanks Edwin Cleton for the report.</li><li> bugfix: segmentation faults might happen when multiple "light threads" in the same request manipuate a stream cosocket object in turn. thanks Aviram Cohen for the report.</li><li> bugfix: timers created by ngx.timer.at() might not be aborted prematurely upon nginx worker exit. thanks Hamish Forbes for the report.</li><li> bugfix: the return value sizes of the C functions <code>ngx_http_lua_init_by_inline</code> and <code>ngx_http_lua_init_by_file</code> were wrong.</li><li> optimize: coroutine status string look-up is now a bit more efficient by specifying the string lengths explicitly. thanks Tatsuhiko Kubo for the patch.</li><li> various code refactoring.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyCoreLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyCoreLibrary" href="null#LuaRestyCoreLibrary" class="externalLink null">LuaRestyCoreLibrary</a> to 0.0.5.<ul><li> change: now it is the user's responsibility to clear the input result table.</li><li> feature: <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-core#restycoreregex" href="https://github.com/agentzh/lua-resty-core#restycoreregex" class="externalLink">resty.core.regex</a>: added new function <code>set_buf_grow_ratio</code> to control the buffer grow ratio (default 2.0).</li><li> bugfix: segmentation fault might happen due to assignments to <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxheaderheader" href="https://github.com/chaoslawful/lua-nginx-module/#ngxheaderheader" class="externalLink">ngx.header.HEADER</a> because we did not anchor the memory buffer properly which might get collected prematurely.</li><li> bugfix: <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxreqget_headers" href="https://github.com/chaoslawful/lua-nginx-module/#ngxreqget_headers" class="externalLink">ngx.req.get_headers</a>: we need to anchor the string buffer being casted otherwise it might be accidentally garbage collected when we still hold a C pointer to it. this bug might lead to segmentation faults.</li><li> optimize: cache the match captures table for <a target="_blank" title="External link to https://github.com/chaoslawful/lua-nginx-module/#ngxregsub" href="https://github.com/chaoslawful/lua-nginx-module/#ngxregsub" class="externalLink">ngx.re.gsub()</a> when a function-typed "replace" argument is specified. this gives a remarkable speedup.</li><li> optimize: <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-core#restycoreregex" href="https://github.com/agentzh/lua-resty-core#restycoreregex" class="externalLink">resty.core.regex</a>: forked the original shared code paths to multiple specialized versions, which helps the JIT compiler.</li><li> optimize: <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-core#restycoreregex" href="https://github.com/agentzh/lua-resty-core#restycoreregex" class="externalLink">resty.core.regex</a>: cache the parsing results for the regex option strings. thanks Mike Pall for the suggestion.</li></ul></li><li> upgraded <a tiddlylink="LuaRestyRedisLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyRedisLibrary" href="null#LuaRestyRedisLibrary" class="externalLink null">LuaRestyRedisLibrary</a> to 0.20.<ul><li> feature: added new redis 2.8.0 commands: <code>scan</code>, <code>sscan</code>, <code>hscan</code>, and <code>zscan</code>. thanks Dragonoid for the patch.</li><li> feature: <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-redis#read_reply" href="https://github.com/agentzh/lua-resty-redis#read_reply" class="externalLink">the read_reply()</a> method can now be re-tried immediately after a "timeout" error is returned.</li><li> bugfix: the <code>unsubscribe</code>/<code>subscribe</code> commands could not be called after <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-redis#read_reply" href="https://github.com/agentzh/lua-resty-redis#read_reply" class="externalLink">read_reply()</a> returned "timeout". thanks doujiang for the patch.</li><li> bugfix: we incorrectly allowed reusing redis connections in the "subscribed" state. thanks doujiang for the patch.</li></ul></li><li> upgraded <a tiddlylink="LuaCjsonLibrary" refresh="link" target="_blank" title="External link to null#LuaCjsonLibrary" href="null#LuaCjsonLibrary" class="externalLink null">LuaCjsonLibrary</a> to 2.1.0.1.<ul><li> rebased on lua-cjson 2.1.0: <a target="_blank" title="External link to http://www.kyne.com.au/~mark/software/NEWS-lua-cjson.txt" href="http://www.kyne.com.au/~mark/software/NEWS-lua-cjson.txt" class="externalLink">http://www.kyne.com.au/~mark/software/NEWS-lua-cjson.txt</a> the most notable new feature is the <code>cjson.safe</code> module.</li><li> feature: applied Jiale Zhi's patch to add the new config function <code>encode_empty_table_as_object</code> so that we can encode empty Lua tables into empty JSON arrays.</li></ul></li><li> upgraded <a tiddlylink="SrcacheNginxModule" refresh="link" target="_blank" title="External link to null#SrcacheNginxModule" href="null#SrcacheNginxModule" class="externalLink null">SrcacheNginxModule</a> to 0.26.<ul><li> bugfix: HEAD requests might result in response bodies.</li></ul></li><li> upgraded <a tiddlylink="EchoNginxModule" refresh="link" target="_blank" title="External link to null#EchoNginxModule" href="null#EchoNginxModule" class="externalLink null">EchoNginxModule</a> to 0.52.<ul><li> bugfix: HEAD subrequests could still result in non-empty response bodies.</li></ul></li></ul>See <a tiddlylink="ChangeLog1005008" refresh="link" target="_blank" title="External link to null#ChangeLog1005008" href="null#ChangeLog1005008" class="externalLink null">ChangeLog1005008</a> for change log for <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> 1.5.8.x.</description>
<link>null#ChangeLog1005011</link>
<pubDate>Tue, 29 Apr 2014 20:55:00 GMT</pubDate>
</item>
<item>
<title>Profiling</title>
<description><a tiddler="Profiling" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>Profiling is important for analyzing and optimize <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> applications' performance.<br><br>We do provide various tools based on Systemtap for profiling live <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> applications both in production and development environments.<br><br>The most useful tools are<br><ul><li> C-land on-CPU Flame Graph tool: <a target="_blank" title="External link to https://github.com/openresty/nginx-systemtap-toolkit#sample-bt" href="https://github.com/openresty/nginx-systemtap-toolkit#sample-bt" class="externalLink">https://github.com/openresty/nginx-systemtap-toolkit#sample-bt</a></li><li> C-land off-CPU Flame Graph tool: <a target="_blank" title="External link to https://github.com/openresty/nginx-systemtap-toolkit#sample-bt-off-cpu" href="https://github.com/openresty/nginx-systemtap-toolkit#sample-bt-off-cpu" class="externalLink">https://github.com/openresty/nginx-systemtap-toolkit#sample-bt-off-cpu</a></li><li> Lua-land on-CPU Flame Graph tool: <a target="_blank" title="External link to https://github.com/openresty/stapxx#lj-lua-stacks" href="https://github.com/openresty/stapxx#lj-lua-stacks" class="externalLink">https://github.com/openresty/stapxx#lj-lua-stacks</a></li></ul><br>It is recommended to build Systemtap from latest release source, see <a tiddlylink="BuildSystemtap" refresh="link" target="_blank" title="External link to null#BuildSystemtap" href="null#BuildSystemtap" class="externalLink null">BuildSystemtap</a> for details.<br><br>If you have problems in interpreting the resulting flame graphs or have troubles getting these tools running in your system, feel free to join our OpenResty <a tiddlylink="Community" refresh="link" target="_blank" title="External link to null#Community" href="null#Community" class="externalLink null">Community</a> and ask for help.</description>
<link>null#Profiling</link>
<pubDate>Tue, 29 Apr 2014 19:18:00 GMT</pubDate>
</item>
<item>
<title>MainMenu</title>
<description><a tiddlylink="About" refresh="link" target="_blank" title="External link to null#About" href="null#About" class="externalLink null">About</a><br><a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">Overview</a><br><a tiddlylink="Benchmark" refresh="link" target="_blank" title="External link to null#Benchmark" href="null#Benchmark" class="externalLink null">Benchmark</a><br><a tiddlylink="Changes" refresh="link" target="_blank" title="External link to null#Changes" href="null#Changes" class="externalLink null">Changes</a><br><a tiddlylink="Community" refresh="link" target="_blank" title="External link to null#Community" href="null#Community" class="externalLink null">Community</a><br><a tiddlylink="Components" refresh="link" target="_blank" title="External link to null#Components" href="null#Components" class="externalLink null">Components</a><br><a tiddlylink="ContactUs" refresh="link" target="_blank" title="External link to null#ContactUs" href="null#ContactUs" class="externalLink null">Contact us</a><br><a tiddlylink="Debugging" refresh="link" target="_blank" title="External link to null#Debugging" href="null#Debugging" class="externalLink null">Debugging</a><br><a tiddlylink="DonateOnline" refresh="link" target="_blank" title="External link to null#DonateOnline" href="null#DonateOnline" class="externalLink null">Donate Online</a><br><a tiddlylink="Download" refresh="link" target="_blank" title="External link to null#Download" href="null#Download" class="externalLink null">Download</a><br><a tiddlylink="eBooks" refresh="link" target="_blank" title="External link to null#eBooks" href="null#eBooks" class="externalLink null">eBooks</a><br><a tiddlylink="GettingInvolved" refresh="link" target="_blank" title="External link to null#GettingInvolved" href="null#GettingInvolved" class="externalLink null">Getting Involved</a><br><a tiddlylink="GettingStarted" refresh="link" target="_blank" title="External link to null#GettingStarted" href="null#GettingStarted" class="externalLink null">Getting Started</a><br><a tiddlylink="Installation" refresh="link" target="_blank" title="External link to null#Installation" href="null#Installation" class="externalLink null">Installation</a><br><a tiddlylink="Presentations" refresh="link" target="_blank" title="External link to null#Presentations" href="null#Presentations" class="externalLink null">Presentations</a><br><a tiddlylink="Profiling" refresh="link" target="_blank" title="External link to null#Profiling" href="null#Profiling" class="externalLink null">Profiling</a><br><a tiddlylink="QualityAssurance" refresh="link" target="_blank" title="External link to null#QualityAssurance" href="null#QualityAssurance" class="externalLink null">Quality Assurance</a><br><a tiddlylink="Resources" refresh="link" target="_blank" title="External link to null#Resources" href="null#Resources" class="externalLink null">Resources</a><br><a tiddlylink="Samples" refresh="link" target="_blank" title="External link to null#Samples" href="null#Samples" class="externalLink null">Samples</a><br><a tiddlylink="Upgrading" refresh="link" target="_blank" title="External link to null#Upgrading" href="null#Upgrading" class="externalLink null">Upgrading</a><br><a target="_blank" title="External link to cn/index.html" href="cn/index.html" class="externalLink">中文维基</a><br><br><img src="feed-icon-14x14.png"> <a tiddlylink="RSSFeed" refresh="link" target="_blank" title="External link to null#RSSFeed" href="null#RSSFeed" class="externalLink null">RSS feed</a><br><br><span>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input name="cmd" value="_xclick" type="hidden">
<input name="business" value="[email protected]" type="hidden">
<input name="item_name" value="OpenResty Donation (in USD)" type="hidden">
<input name="currency_code" value="USD" type="hidden">
<input name="amount" value="" type="hidden">
<input src="donate_button_paypal_01.gif" name="submit" alt="Donate with PayPal" border="0" type="image">
</form>
</span><br><span>
<a href="http://me.alipay.com/agentzh" target="_blank"><img src="donate-with-alipay.png"></a>
</span><br></description>
<category>admin</category>
<link>null#MainMenu</link>
<pubDate>Tue, 29 Apr 2014 19:11:00 GMT</pubDate>
</item>
<item>
<title>OpenResty</title>
<description><a tiddler="OpenResty" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard <a tiddlylink="Nginx" refresh="link" target="_blank" title="External link to null#Nginx" href="null#Nginx" class="externalLink null">Nginx</a> core, lots of <a target="_blank" title="External link to http://wiki.nginx.org/3rdPartyModules" href="http://wiki.nginx.org/3rdPartyModules" class="externalLink">3rd-party Nginx modules</a>, as well as most of their external dependencies.<br><br>By taking advantage of various well-designed Nginx modules, OpenResty effectively turns the nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing nginx C modules and Lua modules and construct extremely high-performance web applications that are capable to handle 10K+ connections.<br><br>OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis.<br><br>OpenResty is <em>not</em> an Nginx fork. It is just a software bundle. Most of the patches applied to the Nginx core in OpenResty have already been submitted to the official Nginx team and most of the patches submitted have also been accepted. We are trying hard <em>not</em> to fork Nginx and always to use the latest best Nginx core from the official Nginx team.<br><br>See <a tiddlylink="Components" refresh="link" target="_blank" title="External link to null#Components" href="null#Components" class="externalLink null">Components</a> for the complete list of software bundled in OpenResty.<br><br>See <a tiddlylink="GettingStarted" refresh="link" target="_blank" title="External link to null#GettingStarted" href="null#GettingStarted" class="externalLink null">GettingStarted</a> on how to quickly setup an OpenResty server that can say hello world over HTTP. Or you can go to the <a tiddlylink="Download" refresh="link" target="_blank" title="External link to null#Download" href="null#Download" class="externalLink null">Download</a> section to grab OpenResty's source code tarball directly.<br><br>We provide free technical support in the openresty and openresty-en mailing lists. See <a tiddlylink="Community" refresh="link" target="_blank" title="External link to null#Community" href="null#Community" class="externalLink null">Community</a>.</description>
<link>null#OpenResty</link>
<pubDate>Wed, 16 Apr 2014 04:15:00 GMT</pubDate>
</item>
<item>
<title>LuaUpstreamNginxModule</title>
<description><a tiddler="LuaUpstreamNginxModule" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>This Nginx C module exposes a Lua API to <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> for classic Nginx upstreams.<br><br>Documentation: <a target="_blank" title="External link to https://github.com/agentzh/lua-upstream-nginx-module#readme" href="https://github.com/agentzh/lua-upstream-nginx-module#readme" class="externalLink">https://github.com/agentzh/lua-upstream-nginx-module#readme</a><br><br>Project page: <a target="_blank" title="External link to https://github.com/agentzh/lua-upstream-nginx-module" href="https://github.com/agentzh/lua-upstream-nginx-module" class="externalLink">https://github.com/agentzh/lua-upstream-nginx-module</a></description>
<link>null#LuaUpstreamNginxModule</link>
<pubDate>Sun, 30 Mar 2014 20:50:00 GMT</pubDate>
</item>
<item>
<title>LuaRestyUpstreamHealthcheckLibrary</title>
<description><a tiddler="LuaRestyUpstreamHealthcheckLibrary" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>Health Checker for Nginx Upstream Servers in Pure Lua.<br><br>Project homepage: <a target="_blank" title="External link to https://github.com/agentzh/lua-resty-upstream-healthcheck" href="https://github.com/agentzh/lua-resty-upstream-healthcheck" class="externalLink">https://github.com/agentzh/lua-resty-upstream-healthcheck</a><br><br>This library is enabled by default. You can specify the <code>--without-lua_resty_upstream_healthcheck</code> option to <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>'s <code>./configure</code> script to explicitly disable it.<br></description>
<link>null#LuaRestyUpstreamHealthcheckLibrary</link>
<pubDate>Sun, 30 Mar 2014 20:48:00 GMT</pubDate>
</item>
<item>
<title>DynamicRoutingBasedOnRedis</title>
<description><a tiddler="DynamicRoutingBasedOnRedis" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>This sample demonstrates how to use Redis to route incoming requests to different HTTP backends based on the requests' <code>User-Agent</code> header.<br><br>This demo uses the components <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> and <a tiddlylink="LuaRestyRedisLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyRedisLibrary" href="null#LuaRestyRedisLibrary" class="externalLink null">LuaRestyRedisLibrary</a> enabled by default in <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>.<br><br>Here's the complete code listing for our <code>nginx.conf</code>:<br><br><pre>worker_processes 2;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location / {
resolver 8.8.4.4; # use Google's open DNS server
set $target '';
access_by_lua '
local key = ngx.var.http_user_agent
if not key then
ngx.log(ngx.ERR, "no user-agent found")
return ngx.exit(400)
end
local redis = require "resty.redis"
local red = redis:new()
red:set_timeout(1000) -- 1 second
local ok, err = red:connect("127.0.0.1", 6379)
if not ok then
ngx.log(ngx.ERR, "failed to connect to redis: ", err)
return ngx.exit(500)
end
local host, err = red:get(key)
if not host then
ngx.log(ngx.ERR, "failed to get redis key: ", err)
return ngx.exit(500)
end
if host == ngx.null then
ngx.log(ngx.ERR, "no host found for key ", key)
return ngx.exit(400)
end
ngx.var.target = host
';
proxy_pass http://$target;
}
}
}
</pre><br>And then let's start the redis server on the localhost:6379:<br><pre>$ ./redis-server # default port is 6379
</pre><br>and feed some keys into this using the redis-cli utility:<br><pre> $ ./redis-cli
redis&gt; set foo apache.org
OK
redis&gt; set bar nginx.org
OK
</pre>And then let's test our nginx app!<br><pre> $ curl --user-agent foo localhost:8080
&lt;apache.org home page goes here&gt;
$ curl --user-agent bar localhost:8080
&lt;nginx.org home page goes here&gt;
</pre>To further tune the performance, one could enable the connection pool for the redis connections, as documented in <a tiddlylink="LuaRestyRedisLibrary" refresh="link" target="_blank" title="External link to null#LuaRestyRedisLibrary" href="null#LuaRestyRedisLibrary" class="externalLink null">LuaRestyRedisLibrary</a>'s README.<br><br>Before you benchmarking your interface defined here, please ensure that you've raised the error log level to <code>warn</code> or <code>notice</code> in your <code>nginx.conf</code> file, as in<br><pre>error_log logs/error.log warn;
</pre>because flushing error log is a very expensive operation and can hurt performance a lot.<br></description>
<link>null#DynamicRoutingBasedOnRedis</link>
<pubDate>Tue, 04 Mar 2014 22:19:00 GMT</pubDate>
</item>
<item>
<title>Presentations</title>
<description><a tiddler="Presentations" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>Here goes a list of slides that I used in my talks regarding <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>.<br><br>These slides are powered by the <a target="_blank" title="External link to https://github.com/kindy61/slides.htm" href="https://github.com/kindy61/slides.htm" class="externalLink">slides.htm</a> slide-making engine based on AJAX.<br><br><strong><em>Note: Please use the arrow keys or pageup/pagedown keys on your keyboard to switch slides.</em></strong><br><h1> Year 2014</h1><h2> NGINX, Lua, and beyond</h2>This talk was given at NGINX Inc's <a target="_blank" title="External link to https://www.eventbrite.com/e/nginx-user-summit-and-training-tickets-10393173261" href="https://www.eventbrite.com/e/nginx-user-summit-and-training-tickets-10393173261" class="externalLink">NGINX User Summit 2014</a> on 25 February 2014.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-user-summit-2014/" href="http://agentzh.org/misc/slides/nginx-user-summit-2014/" class="externalLink">http://agentzh.org/misc/slides/nginx-user-summit-2014/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-lua-and-beyond.pdf" href="http://agentzh.org/misc/slides/nginx-lua-and-beyond.pdf" class="externalLink">http://agentzh.org/misc/slides/nginx-lua-and-beyond.pdf</a><br><br><h1> Year 2013</h1><h2> The Way of Optimizing and Troubleshooting Our Lua Waf</h2>This talk was given at CloudFlare's Beer Meeting on 19 April 2013.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/beer-meeting-2013-04-19/" href="http://agentzh.org/misc/slides/beer-meeting-2013-04-19/" class="externalLink">http://agentzh.org/misc/slides/beer-meeting-2013-04-19/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/beer-meeting-2013-04-19.pdf" href="http://agentzh.org/misc/slides/beer-meeting-2013-04-19.pdf" class="externalLink">http://agentzh.org/misc/slides/beer-meeting-2013-04-19.pdf</a><br><br><h2> sregex: matching Perl 5 regexes on data streams</h2>This talk was given at <a target="_blank" title="External link to http://www.yapcna.org/yn2013/" href="http://www.yapcna.org/yn2013/" class="externalLink">YAPC::NA 2013</a> in Austin, TX, USA.<br><br>Talk summary: <a target="_blank" title="External link to http://www.yapcna.org/yn2013/talk/4762" href="http://www.yapcna.org/yn2013/talk/4762" class="externalLink">http://www.yapcna.org/yn2013/talk/4762</a><br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/yapc-na-2013-sregex/" href="http://agentzh.org/misc/slides/yapc-na-2013-sregex/" class="externalLink">http://agentzh.org/misc/slides/yapc-na-2013-sregex/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/yapc-na-2013-sregex.pdf" href="http://agentzh.org/misc/slides/yapc-na-2013-sregex.pdf" class="externalLink">http://agentzh.org/misc/slides/yapc-na-2013-sregex.pdf</a><br><br><h2> Flame Graphs for online performance profiling</h2>This talk was given at <a target="_blank" title="External link to http://www.yapcna.org/yn2013/" href="http://www.yapcna.org/yn2013/" class="externalLink">YAPC::NA 2013</a> in Austin, TX, USA.<br><br>Talk summary: <a target="_blank" title="External link to http://www.yapcna.org/yn2013/talk/4579" href="http://www.yapcna.org/yn2013/talk/4579" class="externalLink">http://www.yapcna.org/yn2013/talk/4579</a><br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs/" href="http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs/" class="externalLink">http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs.pdf" href="http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs.pdf" class="externalLink">http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs.pdf</a><br><br><h2> Introduction to off-CPU Time Flame Graphs</h2>This talk was given at the CloudFlare Beer Meeting on 23 August 2013.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/off-cpu-flame-graphs/" href="http://agentzh.org/misc/slides/off-cpu-flame-graphs/" class="externalLink">http://agentzh.org/misc/slides/off-cpu-flame-graphs/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/off-cpu-flame-graphs.pdf" href="http://agentzh.org/misc/slides/off-cpu-flame-graphs.pdf" class="externalLink">http://agentzh.org/misc/slides/off-cpu-flame-graphs.pdf</a><br><br><h1> Year 2012</h1><h2> ngx_openresty: an Nginx ecosystem glued by Lua</h2>This talk was given at <a target="_blank" title="External link to http://event.weibo.com/351359" href="http://event.weibo.com/351359" class="externalLink">Tech-Club Technical Salon</a> held in the Xiamen city.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/ngx-openresty-ecosystem/" href="http://agentzh.org/misc/slides/ngx-openresty-ecosystem/" class="externalLink">http://agentzh.org/misc/slides/ngx-openresty-ecosystem/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/ngx-openresty-ecosystem.pdf" href="http://agentzh.org/misc/slides/ngx-openresty-ecosystem.pdf" class="externalLink">http://agentzh.org/misc/slides/ngx-openresty-ecosystem.pdf</a><br><br><h2> Scripting libdrizzle with Lua inside Nginx</h2>This presentation was given at <a target="_blank" title="External link to http://www.percona.com/live/mysql-conference-2012/sessions/scripting-mysql-lua-and-libdrizzle-inside-nginx" href="http://www.percona.com/live/mysql-conference-2012/sessions/scripting-mysql-lua-and-libdrizzle-inside-nginx" class="externalLink">Percona Live MySQL Conference 2012</a> held in Santa Clara, CA, USA.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/libdrizzle-lua-nginx/#2" href="http://agentzh.org/misc/slides/libdrizzle-lua-nginx/#2" class="externalLink">http://agentzh.org/misc/slides/libdrizzle-lua-nginx/#2</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/libdrizzle-lua-nginx.pdf" href="http://agentzh.org/misc/slides/libdrizzle-lua-nginx.pdf" class="externalLink">http://agentzh.org/misc/slides/libdrizzle-lua-nginx.pdf</a><br><br><h1> Year 2011</h1><h2> Applications of ngx_openresty and perl in lz.taobao.com</h2><br>This talk was given at <a target="_blank" title="External link to http://conference.perlchina.org/bjpw2011/talks" href="http://conference.perlchina.org/bjpw2011/talks" class="externalLink">Beijing Perl Workshop 2011</a>.<br><br>Watch the video online: <a target="_blank" title="External link to http://v.ku6.com/show/TY8Vre59guTE_C8o.html" href="http://v.ku6.com/show/TY8Vre59guTE_C8o.html" class="externalLink">http://v.ku6.com/show/TY8Vre59guTE_C8o.html</a><br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/perl-lz-apps/" href="http://agentzh.org/misc/slides/perl-lz-apps/" class="externalLink">http://agentzh.org/misc/slides/perl-lz-apps/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/perl-lz-apps.pdf" href="http://agentzh.org/misc/slides/perl-lz-apps.pdf" class="externalLink">http://agentzh.org/misc/slides/perl-lz-apps.pdf</a><br><br><h1> Year 2010</h1><h2> Introduction to nginx.conf scripting</h2>This talk was given at the <a target="_blank" title="External link to http://conference.perlchina.org" href="http://conference.perlchina.org" class="externalLink">Beijing Perl Workshop</a> 2010 April meeting and the <a target="_blank" title="External link to http://www.beijing-open-party.org/event/2" href="http://www.beijing-open-party.org/event/2" class="externalLink">Beijing OpenParty 2010 June event</a>.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-conf-scripting/" href="http://agentzh.org/misc/slides/nginx-conf-scripting/" class="externalLink">http://agentzh.org/misc/slides/nginx-conf-scripting/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-conf-scripting.pdf" href="http://agentzh.org/misc/slides/nginx-conf-scripting.pdf" class="externalLink">http://agentzh.org/misc/slides/nginx-conf-scripting.pdf</a><br><br>Please note that ngx_eval module is no longer recommended because we're in more favor of ngx_lua nowadays.<br><br><h2> Recent developments in nginx.conf scripting</h2>This talk was given at the <a target="_blank" title="External link to http://www.beijing-open-party.org/event/2" href="http://www.beijing-open-party.org/event/2" class="externalLink">Beijing OpenParty 2010 June event</a>.<br><br>View slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/recent-dev-nginx-conf/" href="http://agentzh.org/misc/slides/recent-dev-nginx-conf/" class="externalLink">http://agentzh.org/misc/slides/recent-dev-nginx-conf/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/recent-dev-nginx-conf.pdf" href="http://agentzh.org/misc/slides/recent-dev-nginx-conf.pdf" class="externalLink">http://agentzh.org/misc/slides/recent-dev-nginx-conf.pdf</a><br><br><h2> The state of the art of nginx.conf scripting</h2>This talk was given at the <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-state-of-the-art/" href="http://agentzh.org/misc/slides/nginx-state-of-the-art/" class="externalLink">ECUG 2010 event</a>.<br><br>Watch the (Chinese-speech) video online: <a target="_blank" title="External link to http://v.ku6.com/show/D00rqtnRwKzJdIsB.html" href="http://v.ku6.com/show/D00rqtnRwKzJdIsB.html" class="externalLink">http://v.ku6.com/show/D00rqtnRwKzJdIsB.html</a><br><br>View the (English) slides in your web browser: <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-state-of-the-art/" href="http://agentzh.org/misc/slides/nginx-state-of-the-art/" class="externalLink">http://agentzh.org/misc/slides/nginx-state-of-the-art/</a><br><br>Download the slides as PDF: <a target="_blank" title="External link to http://agentzh.org/misc/slides/nginx-state-of-the-art.pdf" href="http://agentzh.org/misc/slides/nginx-state-of-the-art.pdf" class="externalLink">http://agentzh.org/misc/slides/nginx-state-of-the-art.pdf</a><br></description>
<category>Resources</category>
<link>null#Presentations</link>
<pubDate>Sat, 01 Mar 2014 01:01:00 GMT</pubDate>
</item>
<item>
<title>UsingLuaRocks</title>
<description><a tiddler="UsingLuaRocks" commandname="permalink" class="button command_permalink" title="Permalink for this tiddler" href="javascript:;">permalink</a><br><br>This sample demonstrates usage of <a target="_blank" title="External link to http://www.luarocks.org/" href="http://www.luarocks.org/" class="externalLink">LuaRocks</a> with <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a>. It's been tested on Linux and Mac OS X, with the standard Lua interpreter or with <a tiddlylink="LuaJIT" refresh="link" target="_blank" title="External link to null#LuaJIT" href="null#LuaJIT" class="externalLink null">LuaJIT</a>.<br><br>LuaRocks is a deployment and management system for Lua modules. LuaRocks allows one to install Lua modules as self-contained packages called "rocks", which also contain version dependency information.<br><br>We assume that you have installed <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> into the default location, i.e., <code>/usr/local/openresty</code>. You can adjust the paths in this sample according to the actual installation prefix of your <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> installation. If you haven't installed OpenResty yet, check out the <a tiddlylink="Download" refresh="link" target="_blank" title="External link to null#Download" href="null#Download" class="externalLink null">Download</a> and <a tiddlylink="Installation" refresh="link" target="_blank" title="External link to null#Installation" href="null#Installation" class="externalLink null">Installation</a> pages.<br><br><h1> Install LuaRocks</h1>First of all, let's install LuaRocks:<br><br>Download the LuaRocks tarball from <a tiddlylink="http://www.luarocks.org/en/Download" refresh="link" target="_blank" title="External link to null#http://www.luarocks.org/en/Download" href="null#http://www.luarocks.org/en/Download" class="externalLink null">http://www.luarocks.org/en/Download</a>. As of this writing, the latest version is <code>2.1.2</code>, but we'll use <code>2.0.13</code> for compatibility throughout this sample.<br><pre>wget http://luarocks.org/releases/luarocks-2.0.13.tar.gz
tar -xzvf luarocks-2.0.13.tar.gz
cd luarocks-2.0.13/
./configure --prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit/ \
--lua-suffix=jit-2.1.0-alpha \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make
sudo make install
</pre><h1> Install the Lua MD5 library with LuaRocks</h1>In this sample, we'll use the Lua MD5 library to serve as an example, so let's install it with LuaRocks:<br><pre>sudo /usr/local/openresty/luajit/luarocks install md5
</pre><h1> Configuring our OpenResty application</h1>Let's change the current directory to <code>/usr/local/openresty/nginx/</code>:<br><pre>cd /usr/local/openresty/nginx/
</pre>Next, edit the <code>conf/nginx.conf</code> file to the following contents with your favorite text editor (like vim or emacs):<br><pre>worker_processes 1; # we could enlarge this setting on a multi-core machine
error_log logs/error.log warn;
events {
worker_connections 1024;
}
http {
lua_package_path 'conf/?.lua;;';
server {
listen 80;
server_name localhost;
location = /luarocks {
content_by_lua '
local foo = require("foo")
foo.say("hello, luarocks!")
';
}
}
}
</pre>Finally, create the following two Lua module files <code>conf/foo.lua</code><br><pre>-- conf/foo.lua
module("foo", package.seeall)
local bar = require "bar"
ngx.say("bar loaded")
function say (var)
bar.say(var)
end
</pre>and <code>conf/bar.lua</code><br><pre>-- conf/bar.lua
module("bar", package.seeall)
local rocks = require "luarocks.loader"
local md5 = require "md5"
ngx.say("rocks and md5 loaded")
function say (a)
ngx.say(md5.sumhexa(a))
end
</pre><h1> Start the Nginx server</h1>Now we start the Nginx server with our app:<br><pre>ulimit -n1024 # increase the maximal fd count limit per process
./sbin/nginx
</pre>If you have already started the Nginx server, then stop it before starting it:<br><pre>./sbin/nginx -s stop
</pre><h1> Test our app</h1>Now we can test our app via the <code>curl</code> utility or any HTTP compliant clients like a web browser:<br><pre>curl http://localhost/luarocks
</pre>we could get the following outputs at the first run:<br><pre>rocks and md5 loaded
bar loaded
85e73df5c41378f830c031b81e4453d2
</pre>then at the second run:<br><pre>85e73df5c41378f830c031b81e4453d2
</pre>The output changed because <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> by default caches already loaded Lua modules and those outputing code run at Lua module loading time will no longer be run.<br><br>Now let's do some benchmark:<br><pre>ab -c10 -n50000 http://127.0.0.1/luarocks
</pre>On my Thinkpad T400 laptop (Core2Duo T9600 CPU), it yields<br><pre>Server Software: ngx_openresty/1.0.4.2rc10
Server Hostname: localhost
Server Port: 80
Document Path: /luarocks
Document Length: 33 bytes
Concurrency Level: 10
Time taken for tests: 3.052 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 9400188 bytes
HTML transferred: 1650033 bytes
Requests per second: 16380.48 [#/sec] (mean)
Time per request: 0.610 [ms] (mean)
Time per request: 0.061 [ms] (mean, across all concurrent requests)
Transfer rate: 3007.41 [Kbytes/sec] received
</pre>Note that the throughput is achieved by a single nginx worker process. While doing such benchmark on your own, just be careful about error log level settings in your nginx.conf and not to run out of dynamic port range on your local machine, or it'll be significantly slow after a short of period of time.<br><h1> Known issues</h1>Pior to <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> 1.0.4.2rc10, it's known that turning <code>lua_code_cache</code> on will cause LuaRocks atop <a tiddlylink="LuaNginxModule" refresh="link" target="_blank" title="External link to null#LuaNginxModule" href="null#LuaNginxModule" class="externalLink null">LuaNginxModule</a> to throw out the following exception in <code>error.log</code>:<br><pre>lua handler aborted: runtime error: stack overflow
</pre>If you're using any version of <a tiddlylink="OpenResty" refresh="link" target="_blank" title="External link to null#OpenResty" href="null#OpenResty" class="externalLink null">OpenResty</a> before 1.0.4.2rc10, please consider upgrading.<br></description>
<link>null#UsingLuaRocks</link>
<pubDate>Sat, 25 Jan 2014 17:59:00 GMT</pubDate>
</item>
</channel>
</rss>