• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

misc/H19-Apr-2018-4030

src/H19-Apr-2018-2,1751,677

t/H19-Apr-2018-1,058847

util/H19-Apr-2018-7649

.gitattributesH A D19-Apr-201827 21

.gitignoreH A D19-Apr-2018619 6665

.travis.ymlH A D19-Apr-20182 KiB6858

ChangesH A D19-Apr-20181.5 KiB1816

README.markdownH A D19-Apr-201824.1 KiB764526

configH A D19-Apr-20181.2 KiB3025

valgrind.suppressH A D19-Apr-20182.9 KiB155154

README.markdown

1Name
2====
3
4ngx_redis2 - Nginx upstream module for the Redis 2.0 protocol
5
6*This module is not distributed with the Nginx source.* See [the installation instructions](#installation).
7
8Table of Contents
9=================
10
11* [Name](#name)
12* [Status](#status)
13* [Version](#version)
14* [Synopsis](#synopsis)
15* [Description](#description)
16* [Directives](#directives)
17    * [redis2_query](#redis2_query)
18    * [redis2_raw_query](#redis2_raw_query)
19    * [redis2_raw_queries](#redis2_raw_queries)
20    * [redis2_literal_raw_query](#redis2_literal_raw_query)
21    * [redis2_pass](#redis2_pass)
22    * [redis2_connect_timeout](#redis2_connect_timeout)
23    * [redis2_send_timeout](#redis2_send_timeout)
24    * [redis2_read_timeout](#redis2_read_timeout)
25    * [redis2_buffer_size](#redis2_buffer_size)
26    * [redis2_next_upstream](#redis2_next_upstream)
27* [Connection Pool](#connection-pool)
28* [Selecting Redis Databases](#selecting-redis-databases)
29* [Lua Interoperability](#lua-interoperability)
30    * [Pipelined Redis Requests by Lua](#pipelined-redis-requests-by-lua)
31* [Redis Publish/Subscribe Support](#redis-publishsubscribe-support)
32    * [Limitations For Redis Publish/Subscribe](#limitations-for-redis-publishsubscribe)
33* [Performance Tuning](#performance-tuning)
34* [Installation](#installation)
35* [Compatibility](#compatibility)
36* [Community](#community)
37    * [English Mailing List](#english-mailing-list)
38    * [Chinese Mailing List](#chinese-mailing-list)
39* [Bugs and Patches](#bugs-and-patches)
40* [Source Repository](#source-repository)
41* [TODO](#todo)
42* [Author](#author)
43* [Getting involved](#getting-involved)
44* [Copyright & License](#copyright--license)
45* [SEE ALSO](#see-also)
46
47Status
48======
49
50This module is already production ready.
51
52Version
53=======
54
55This document describes ngx_redis2 [v0.15](https://github.com/openresty/redis2-nginx-module/tags) released on 19 April 2018.
56
57Synopsis
58========
59
60```nginx
61
62 location = /foo {
63     set $value 'first';
64     redis2_query set one $value;
65     redis2_pass 127.0.0.1:6379;
66 }
67
68 # GET /get?key=some_key
69 location = /get {
70     set_unescape_uri $key $arg_key;  # this requires ngx_set_misc
71     redis2_query get $key;
72     redis2_pass foo.com:6379;
73 }
74
75 # GET /set?key=one&val=first%20value
76 location = /set {
77     set_unescape_uri $key $arg_key;  # this requires ngx_set_misc
78     set_unescape_uri $val $arg_val;  # this requires ngx_set_misc
79     redis2_query set $key $val;
80     redis2_pass foo.com:6379;
81 }
82
83 # multiple pipelined queries
84 location = /foo {
85     set $value 'first';
86     redis2_query set one $value;
87     redis2_query get one;
88     redis2_query set one two;
89     redis2_query get one;
90     redis2_pass 127.0.0.1:6379;
91 }
92
93 location = /bar {
94     # $ is not special here...
95     redis2_literal_raw_query '*1\r\n$4\r\nping\r\n';
96     redis2_pass 127.0.0.1:6379;
97 }
98
99 location = /bar {
100     # variables can be used below and $ is special
101     redis2_raw_query 'get one\r\n';
102     redis2_pass 127.0.0.1:6379;
103 }
104
105 # GET /baz?get%20foo%0d%0a
106 location = /baz {
107     set_unescape_uri $query $query_string; # this requires the ngx_set_misc module
108     redis2_raw_query $query;
109     redis2_pass 127.0.0.1:6379;
110 }
111
112 location = /init {
113     redis2_query del key1;
114     redis2_query lpush key1 C;
115     redis2_query lpush key1 B;
116     redis2_query lpush key1 A;
117     redis2_pass 127.0.0.1:6379;
118 }
119
120 location = /get {
121     redis2_query lrange key1 0 -1;
122     redis2_pass 127.0.0.1:6379;
123 }
124```
125
126[Back to TOC](#table-of-contents)
127
128Description
129===========
130
131This is an Nginx upstream module that makes nginx talk to a [Redis](http://redis.io/) 2.x server in a non-blocking way. The full Redis 2.0 unified protocol has been implemented including the Redis pipelining support.
132
133This module returns the raw TCP response from the Redis server. It's recommended to use my [lua-redis-parser](http://github.com/openresty/lua-redis-parser) (written in pure C) to parse these responses into lua data structure when combined with [lua-nginx-module](http://github.com/openresty/lua-nginx-module).
134
135When used in conjunction with [lua-nginx-module](http://github.com/openresty/lua-nginx-module), it is recommended to use the [lua-resty-redis](http://github.com/openresty/lua-resty-redis) library instead of this module though, because the former is much more flexible and memory-efficient.
136
137If you only want to use the `get` redis command, you can try out the [HttpRedisModule](http://wiki.nginx.org/HttpRedisModule). It returns the parsed content part of the Redis response because only `get` is needed to implement.
138
139Another option is to parse the redis responses on your client side yourself.
140
141[Back to TOC](#table-of-contents)
142
143Directives
144==========
145
146[Back to TOC](#table-of-contents)
147
148redis2_query
149------------
150**syntax:** *redis2_query cmd arg1 arg2 ...*
151
152**default:** *no*
153
154**context:** *location, location if*
155
156Specify a Redis command by specifying its individual arguments (including the Redis command name itself) in a similar way to the `redis-cli` utility.
157
158Multiple instances of this directive are allowed in a single location and these queries will be pipelined. For example,
159
160```nginx
161
162 location = /pipelined {
163     redis2_query set hello world;
164     redis2_query get hello;
165
166     redis2_pass 127.0.0.1:$TEST_NGINX_REDIS_PORT;
167 }
168```
169
170then `GET /pipelined` will yield two successive raw Redis responses
171
172```nginx
173
174 +OK
175 $5
176 world
177```
178
179while newlines here are actually `CR LF` (`\r\n`).
180
181[Back to TOC](#table-of-contents)
182
183redis2_raw_query
184----------------
185**syntax:** *redis2_raw_query QUERY*
186
187**default:** *no*
188
189**context:** *location, location if*
190
191Specify raw Redis queries and nginx variables are recognized in the `QUERY` argument.
192
193Only *one* Redis command is allowed in the `QUERY` argument, or you'll receive an error. If you want to specify multiple pipelined commands in a single query, use the [redis2_raw_queries](#redis2_raw_queries) directive instead.
194
195[Back to TOC](#table-of-contents)
196
197redis2_raw_queries
198------------------
199**syntax:** *redis2_raw_queries N QUERIES*
200
201**default:** *no*
202
203**context:** *location, location if*
204
205Specify `N` commands in the `QUERIES` argument. Both the `N` and `QUERIES`
206arguments can take Nginx variables.
207
208Here's some examples
209```nginx
210
211 location = /pipelined {
212     redis2_raw_queries 3 "flushall\r\nget key1\r\nget key2\r\n";
213     redis2_pass 127.0.0.1:6379;
214 }
215
216 # GET /pipelined2?n=2&cmds=flushall%0D%0Aget%20key%0D%0A
217 location = /pipelined2 {
218     set_unescape_uri $n $arg_n;
219     set_unescape_uri $cmds $arg_cmds;
220
221     redis2_raw_queries $n $cmds;
222
223     redis2_pass 127.0.0.1:6379;
224 }
225```
226Note that in the second sample above, the [set_unescape_uri](http://github.com/openresty/set-misc-nginx-module#set_unescape_uri) directive is provided by the [set-misc-nginx-module](http://github.com/openresty/set-misc-nginx-module).
227
228[Back to TOC](#table-of-contents)
229
230redis2_literal_raw_query
231------------------------
232**syntax:** *redis2_literal_raw_query QUERY*
233
234**default:** *no*
235
236**context:** *location, location if*
237
238Specify a raw Redis query but Nginx variables in it will not be *not* recognized. In other words, you're free to use the dollar sign character (`$`) in your `QUERY` argument.
239
240Only One redis command is allowed in the `QUERY` argument.
241
242[Back to TOC](#table-of-contents)
243
244redis2_pass
245-----------
246**syntax:** *redis2_pass <upstream_name>*
247
248**syntax:** *redis2_pass <host>:<port>*
249
250**default:** *no*
251
252**context:** *location, location if*
253
254**phase:** *content*
255
256Specify the Redis server backend.
257
258[Back to TOC](#table-of-contents)
259
260redis2_connect_timeout
261----------------------
262**syntax:** *redis2_connect_timeout <time>*
263
264**default:** *60s*
265
266**context:** *http, server, location*
267
268The timeout for connecting to the Redis server, in seconds by default.
269
270It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are `s`(seconds), `ms`(milliseconds), `y`(years), `M`(months), `w`(weeks), `d`(days), `h`(hours), and `m`(minutes).
271
272This time must be less than 597 hours.
273
274[Back to TOC](#table-of-contents)
275
276redis2_send_timeout
277-------------------
278**syntax:** *redis2_send_timeout <time>*
279
280**default:** *60s*
281
282**context:** *http, server, location*
283
284The timeout for sending TCP requests to the Redis server, in seconds by default.
285
286It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are `s`(seconds), `ms`(milliseconds), `y`(years), `M`(months), `w`(weeks), `d`(days), `h`(hours), and `m`(minutes).
287
288[Back to TOC](#table-of-contents)
289
290redis2_read_timeout
291-------------------
292**syntax:** *redis2_read_timeout <time>*
293
294**default:** *60s*
295
296**context:** *http, server, location*
297
298The timeout for reading TCP responses from the redis server, in seconds by default.
299
300It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are `s`(seconds), `ms`(milliseconds), `y`(years), `M`(months), `w`(weeks), `d`(days), `h`(hours), and `m`(minutes).
301
302[Back to TOC](#table-of-contents)
303
304redis2_buffer_size
305------------------
306**syntax:** *redis2_buffer_size <size>*
307
308**default:** *4k/8k*
309
310**context:** *http, server, location*
311
312This buffer size is used for reading Redis replies, but it's not required to be as big as the largest possible Redis reply.
313
314This default size is the page size, may be 4k or 8k.
315
316[Back to TOC](#table-of-contents)
317
318redis2_next_upstream
319--------------------
320**syntax:** *redis2_next_upstream [ error | timeout | invalid_response | off ]*
321
322**default:** *error timeout*
323
324**context:** *http, server, location*
325
326Specify which failure conditions should cause the request to be forwarded to another
327upstream server. Applies only when the value in [redis2_pass](#redis2_pass) is an upstream with two or more
328servers.
329
330Here's an artificial example:
331```nginx
332
333 upstream redis_cluster {
334     server 127.0.0.1:6379;
335     server 127.0.0.1:6380;
336 }
337
338 server {
339     location = /redis {
340         redis2_next_upstream error timeout invalid_response;
341         redis2_query get foo;
342         redis2_pass redis_cluster;
343     }
344 }
345```
346
347[Back to TOC](#table-of-contents)
348
349Connection Pool
350===============
351
352You can use the excellent [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule) with this module to provide TCP connection pool for Redis.
353
354A sample config snippet looks like this
355
356```nginx
357
358 http {
359     upstream backend {
360       server 127.0.0.1:6379;
361
362       # a pool with at most 1024 connections
363       # and do not distinguish the servers:
364       keepalive 1024;
365     }
366
367     server {
368         ...
369         location = /redis {
370             set_unescape_uri $query $arg_query;
371             redis2_query $query;
372             redis2_pass backend;
373         }
374     }
375 }
376```
377
378[Back to TOC](#table-of-contents)
379
380Selecting Redis Databases
381=========================
382
383Redis provides the [select](http://redis.io/commands/SELECT) command to switch Redis databaess. This command is no different from other normal commands
384like [get](http://redis.io/commands/GET) or [set](http://redis.io/commands/SET). So you can use them in [redis2_query](#redis2_query) directives, for
385example,
386
387```nginx
388redis2_query select 8;
389redis2_query get foo;
390```
391
392[Back to TOC](#table-of-contents)
393
394Lua Interoperability
395====================
396
397This module can be served as a non-blocking redis2 client for [lua-nginx-module](http://github.com/openresty/lua-nginx-module) (but nowadays it is recommended to use the [lua-resty-redis](http://github.com/openresty/lua-resty-redis) library instead, which is much simpler to use and more efficient most of the time).
398Here's an example using a GET subrequest:
399
400```nginx
401
402 location = /redis {
403     internal;
404
405     # set_unescape_uri is provided by ngx_set_misc
406     set_unescape_uri $query $arg_query;
407
408     redis2_raw_query $query;
409     redis2_pass 127.0.0.1:6379;
410 }
411
412 location = /main {
413     content_by_lua '
414         local res = ngx.location.capture("/redis",
415             { args = { query = "ping\\r\\n" } }
416         )
417         ngx.print("[" .. res.body .. "]")
418     ';
419 }
420```
421
422Then accessing `/main` yields
423
424
425    [+PONG\r\n]
426
427
428where `\r\n` is `CRLF`. That is, this module returns the *raw* TCP responses from the remote redis server. For Lua-based application developers, they may want to utilize the [lua-redis-parser](http://github.com/openresty/lua-redis-parser) library (written in pure C) to parse such raw responses into Lua data structures.
429
430When moving the inlined Lua code into an external `.lua` file, it's important to use the escape sequence `\r\n` directly. We used `\\r\\n` above just because the Lua code itself needs quoting when being put into an Nginx string literal.
431
432You can also use POST/PUT subrequests to transfer the raw Redis request via request body, which does not require URI escaping and unescaping, thus saving some CPU cycles. Here's such an example:
433
434```nginx
435
436 location = /redis {
437     internal;
438
439     # $echo_request_body is provided by the ngx_echo module
440     redis2_raw_query $echo_request_body;
441
442     redis2_pass 127.0.0.1:6379;
443 }
444
445 location = /main {
446     content_by_lua '
447         local res = ngx.location.capture("/redis",
448             { method = ngx.HTTP_PUT,
449               body = "ping\\r\\n" }
450         )
451         ngx.print("[" .. res.body .. "]")
452     ';
453 }
454```
455
456This yeilds exactly the same output as the previous (GET) sample.
457
458One can also use Lua to pick up a concrete Redis backend based on some complicated hashing rules. For instance,
459
460```nginx
461
462 upstream redis-a {
463     server foo.bar.com:6379;
464 }
465
466 upstream redis-b {
467     server bar.baz.com:6379;
468 }
469
470 upstream redis-c {
471     server blah.blah.org:6379;
472 }
473
474 server {
475     ...
476
477     location = /redis {
478         set_unescape_uri $query $arg_query;
479         redis2_query $query;
480         redis2_pass $arg_backend;
481     }
482
483     location = /foo {
484         content_by_lua "
485             -- pick up a server randomly
486             local servers = {'redis-a', 'redis-b', 'redis-c'}
487             local i = ngx.time() % #servers + 1;
488             local srv = servers[i]
489
490             local res = ngx.location.capture('/redis',
491                 { args = {
492                     query = '...',
493                     backend = srv
494                   }
495                 }
496             )
497             ngx.say(res.body)
498         ";
499     }
500 }
501```
502
503[Back to TOC](#table-of-contents)
504
505Pipelined Redis Requests by Lua
506-------------------------------
507
508Here's a complete example demonstrating how to use Lua to issue multiple pipelined Redis requests via this Nginx module.
509
510First of all, we include the following in our `nginx.conf` file:
511
512```nginx
513
514 location = /redis2 {
515     internal;
516
517     redis2_raw_queries $args $echo_request_body;
518     redis2_pass 127.0.0.1:6379;
519 }
520
521 location = /test {
522     content_by_lua_file conf/test.lua;
523 }
524```
525
526Basically we use URI query args to pass the number of Redis requests and request body to pass the pipelined Redis request string.
527
528And then we create the `conf/test.lua` file (whose path is relative to the server root of Nginx) to include the following Lua code:
529
530```lua
531
532 -- conf/test.lua
533 local parser = require "redis.parser"
534
535 local reqs = {
536     {"set", "foo", "hello world"},
537     {"get", "foo"}
538 }
539
540 local raw_reqs = {}
541 for i, req in ipairs(reqs) do
542     table.insert(raw_reqs, parser.build_query(req))
543 end
544
545 local res = ngx.location.capture("/redis2?" .. #reqs,
546     { body = table.concat(raw_reqs, "") })
547
548 if res.status ~= 200 or not res.body then
549     ngx.log(ngx.ERR, "failed to query redis")
550     ngx.exit(500)
551 end
552
553 local replies = parser.parse_replies(res.body, #reqs)
554 for i, reply in ipairs(replies) do
555     ngx.say(reply[1])
556 end
557```
558
559Here we assume that your Redis server is listening on the default port (6379) of the localhost. We also make use of the [lua-redis-parser](http://github.com/openresty/lua-redis-parser) library to construct raw Redis queries for us and also use it to parse the replies.
560
561Accessing the `/test` location via HTTP clients like `curl` yields the following output
562
563
564    OK
565    hello world
566
567
568A more realistic setting is to use a proper upstream definition for our Redis backend and enable TCP connection pool via the [keepalive](http://wiki.nginx.org/HttpUpstreamKeepaliveModule#keepalive) directive in it.
569
570[Back to TOC](#table-of-contents)
571
572Redis Publish/Subscribe Support
573===============================
574
575This module has limited support for Redis publish/subscribe feature. It cannot be fully supported due to the stateless nature of REST and HTTP model.
576
577Consider the following example:
578
579```nginx
580
581 location = /redis {
582     redis2_raw_queries 2 "subscribe /foo/bar\r\n";
583     redis2_pass 127.0.0.1:6379;
584 }
585```
586
587And then publish a message for the key `/foo/bar` in the `redis-cli` command line. And then you'll receive two multi-bulk replies from the `/redis` location.
588
589You can surely parse the replies with the [lua-redis-parser](http://github.com/openresty/lua-redis-parser) library if you're using Lua to access this module's location.
590
591[Back to TOC](#table-of-contents)
592
593Limitations For Redis Publish/Subscribe
594---------------------------------------
595
596If you want to use the [Redis pub/sub](http://redis.io/topics/pubsub) feature with this module, then you must note the following limitations:
597
598* You cannot use [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule) with this Redis upstream. Only short Redis connections will work.
599* There may be some race conditions that produce the harmless `Redis server returned extra bytes` warnings in your nginx's error.log. Such warnings might be rare but just be prepared for it.
600* You should tune the various timeout settings provided by this module like [redis2_connect_timeout](#redis2_connect_timeout) and [redis2_read_timeout](#redis2_read_timeout).
601
602If you cannot stand these limitations, then you are highly recommended to switch to the [lua-resty-redis](https://github.com/openresty/lua-resty-redis) library for [lua-nginx-module](http://github.com/openresty/lua-nginx-module).
603
604[Back to TOC](#table-of-contents)
605
606Performance Tuning
607==================
608
609* When you're using this module, please ensure you're using a TCP connection pool (provided by [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule)) and Redis pipelining wherever possible. These features will significantly improve performance.
610* Using multiple instance of Redis servers on your multi-core machines also help a lot due to the sequential processing nature of a single Redis server instance.
611* When you're benchmarking performance using something like `ab` or `http_load`, please ensure that your error log level is high enough (like `warn`) to prevent Nginx workers spend too much cycles on flushing the `error.log` file, which is always non-buffered and blocking and thus very expensive.
612
613[Back to TOC](#table-of-contents)
614
615Installation
616============
617
618You are recommended to install this module (as well as the Nginx core and many many other goodies) via the [ngx_openresty bundle](http://openresty.org). Check out the [installation instructions](http://openresty.org/#Installation) for setting up [ngx_openresty](http://openresty.org).
619
620Alternatively, you can install this module manually by recompiling the standard Nginx core as follows:
621
622* Grab the nginx source code from [nginx.org](http://nginx.org), for example, the version 1.11.2 (see nginx compatibility),
623* and then download the latest version of the release tarball of this module from ngx_redis2's [file list](http://github.com/openresty/redis2-nginx-module/tags).
624* and finally build the source with this module:
625```bash
626
627 wget 'http://nginx.org/download/nginx-1.11.2.tar.gz'
628 tar -xzvf nginx-1.11.2.tar.gz
629 cd nginx-1.11.2/
630
631 # Here we assume you would install you nginx under /opt/nginx/.
632 ./configure --prefix=/opt/nginx \
633             --add-module=/path/to/redis2-nginx-module
634
635 make -j2
636 make install
637```
638
639Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the
640`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module)
641directive, for example,
642
643```nginx
644load_module /path/to/modules/ngx_http_redis2_module.so;
645```
646
647[Back to TOC](#table-of-contents)
648
649Compatibility
650=============
651
652Redis 2.0, 2.2, 2.4, and above should work with this module without any issues. So is the [Alchemy Database](http://code.google.com/p/alchemydatabase/) (aka redisql in its early days).
653
654The following versions of Nginx should work with this module:
655
656* 1.11.x (last tested: 1.11.2)
657* 1.10.x
658* 1.9.x (last tested: 1.9.15)
659* 1.8.x
660* 1.7.x (last tested: 1.7.10)
661* 1.6.x
662* 1.5.x (last tested: 1.5.12)
663* 1.4.x (last tested: 1.4.3)
664* 1.3.x (last tested: 1.3.7)
665* 1.2.x (last tested: 1.2.7)
666* 1.1.x (last tested: 1.1.5)
667* 1.0.x (last tested: 1.0.10)
668* 0.9.x (last tested: 0.9.4)
669* 0.8.x >= 0.8.31 (last tested: 0.8.54)
670
671Earlier versions of Nginx will *not* work.
672
673If you find that any particular version of Nginx above 0.8.31 does not work with this module, please consider reporting a bug.
674
675[Back to TOC](#table-of-contents)
676
677Community
678=========
679
680[Back to TOC](#table-of-contents)
681
682English Mailing List
683--------------------
684
685The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers.
686
687[Back to TOC](#table-of-contents)
688
689Chinese Mailing List
690--------------------
691
692The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers.
693
694[Back to TOC](#table-of-contents)
695
696Bugs and Patches
697================
698
699Please submit bug reports, wishlists, or patches by
700
7011. creating a ticket on the [GitHub Issue Tracker](http://github.com/openresty/redis2-nginx-module/issues),
7021. or posting to the [OpenResty community](#community).
703
704[Back to TOC](#table-of-contents)
705
706Source Repository
707=================
708
709Available on github at [openresty/redis2-nginx-module](http://github.com/openresty/redis2-nginx-module).
710
711[Back to TOC](#table-of-contents)
712
713TODO
714====
715* Add the `redis2_as_json` directive to allow emitting JSON directly.
716
717[Back to TOC](#table-of-contents)
718
719Author
720======
721
722Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>, OpenResty Inc.
723
724[Back to TOC](#table-of-contents)
725
726Getting involved
727================
728
729You'll be very welcomed to submit patches to the author or just ask for
730a commit bit to the source repository on GitHub.
731
732[Back to TOC](#table-of-contents)
733
734Copyright & License
735===================
736
737This module is licenced under the BSD license.
738
739Copyright (C) 2010-2018, by Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>, OpenResty Inc.
740
741All rights reserved.
742
743Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
744
745* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
746
747* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
748
749THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
750
751[Back to TOC](#table-of-contents)
752
753SEE ALSO
754========
755* The [Redis](http://redis.io/) server homepage.
756* The Redis wire protocol: <http://redis.io/topics/protocol>
757* a redis response parser and a request constructor for Lua: [lua-redis-parser](http://github.com/openresty/lua-redis-parser).
758* [lua-nginx-module](http://github.com/openresty/lua-nginx-module)
759* The [ngx_openresty bundle](http://openresty.org).
760* The [lua-resty-redis](https://github.com/openresty/lua-resty-redis) library based on the [lua-nginx-module](http://github.com/openresty/lua-nginx-module) cosocket API.
761
762[Back to TOC](#table-of-contents)
763
764