8
8
This module is already production ready.
9
9
10
10
Version
11
-
This document describes ngx_redis2 v0.08rc2
12
-
(<https://github.com/agentzh/redis2-nginx-module/tags>) released on 24
13
-
November 2011.
11
+
This document describes ngx_redis2 v0.09
12
+
(<https://github.com/agentzh/redis2-nginx-module/tags>) released on 8
13
+
September 2012.
14
14
15
15
Synopsis
16
16
location /foo {
@@ -63,6 +63,19 @@ Synopsis
63
63
redis2_pass 127.0.0.1:6379;
64
64
}
65
65
66
+
location /init {
67
+
redis2_query del key1;
68
+
redis2_query lpush key1 C;
69
+
redis2_query lpush key1 B;
70
+
redis2_query lpush key1 A;
71
+
redis2_pass 127.0.0.1:6379;
72
+
}
73
+
74
+
location /get {
75
+
redis2_query lrange key1 0 -1;
76
+
redis2_pass 127.0.0.1:6379;
77
+
}
78
+
66
79
Description
67
80
This is an Nginx upstream module that makes nginx talk to a Redis
68
81
(<http://redis.io/>) 2.x server in a non-blocking way. The full Redis
@@ -265,7 +278,7 @@ Connection Pool
265
278
266
279
# a pool with at most 1024 connections
267
280
# and do not distinguish the servers:
268
-
keepalive 1024 single;
281
+
keepalive 1024;
269
282
}
270
283
271
284
server {
@@ -280,9 +293,10 @@ Connection Pool
280
293
281
294
Lua Interoperability
282
295
This module can be served as a non-blocking redis2 client for
283
-
[[HttpLuaModule]].
284
-
285
-
Here's an example using a GET subrequest:
296
+
[[HttpLuaModule]] (but nowadays it is recommended to use the
297
+
lua-resty-redis (<http://github.com/agentzh/lua-resty-redis>) library
298
+
instead, which is much simpler to use and more efficient most of the
299
+
time). Here's an example using a GET subrequest:
286
300
287
301
location /redis {
288
302
internal;
@@ -506,17 +520,17 @@ Installation
506
520
standard Nginx core as follows:
507
521
508
522
* Grab the nginx source code from nginx.org (<http://nginx.org>), for
509
-
example, the version 1.0.8 (see nginx compatibility),
523
+
example, the version 1.2.1 (see nginx compatibility),
510
524
511
525
* and then download the latest version of the release tarball of this
512
526
module from ngx_redis2's file list
513
527
(<http://github.com/agentzh/redis2-nginx-module/tags>).
514
528
515
529
* and finally build the source with this module:
516
530
517
-
wget 'http://nginx.org/download/nginx-1.0.8.tar.gz'
518
-
tar -xzvf nginx-1.0.8.tar.gz
519
-
cd nginx-1.0.8/
531
+
wget 'http://nginx.org/download/nginx-1.2.1.tar.gz'
532
+
tar -xzvf nginx-1.2.1.tar.gz
533
+
cd nginx-1.2.1/
520
534
521
535
# Here we assume you would install you nginx under /opt/nginx/.
522
536
./configure --prefix=/opt/nginx \
@@ -526,13 +540,17 @@ Installation
526
540
make install
527
541
528
542
Compatibility
529
-
Redis 2.0, 2.2, and above should work with this module without any
543
+
Redis 2.0, 2.2, 2.4, and above should work with this module without any
530
544
issues. So is the Alchemy Database
531
545
(<http://code.google.com/p/alchemydatabase/>) (aka redisql in its early
532
546
days).
533
547
534
548
The following versions of Nginx should work with this module:
535
549
550
+
* 1.3.x (last tested: 1.3.4)
551
+
552
+
* 1.2.x (last tested: 1.2.3)
553
+
536
554
* 1.1.x (last tested: 1.1.5)
537
555
538
556
* 1.0.x (last tested: 1.0.10)
566
584
* Add the "redis2_as_json" directive to allow emitting JSON directly.
567
585
568
586
Author
569
-
Zhang "agentzh" Yichun (章亦春) <agentzh@gmail.com>
587
+
Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>
570
588
571
589
Getting involved
572
590
You'll be very welcomed to submit patches to the author or just ask for
@@ -575,7 +593,7 @@ Getting involved
575
593
Copyright & License
576
594
This module is licenced under the BSD license.
577
595
578
-
Copyright (C) 2010, 2011, by Zhang "agentzh" Yichun (章亦春)
596
+
Copyright (C) 2010-2012, by Yichun "agentzh" Zhang (章亦春)
579
597
<agentzh@gmail.com>.
580
598
581
599
All rights reserved.
@@ -606,10 +624,15 @@ Copyright & License
606
624
SEE ALSO
607
625
* The Redis (<http://redis.io/>) server homepage.
608
626
627
+
* The Redis wire protocol: http://redis.io/topics/protocol
628
+
609
629
* a redis response parser and a request constructor for Lua:
610
630
[[LuaRedisParser]].
611
631
612
632
* [[HttpLuaModule]]
613
633
614
634
* The ngx_openresty bundle (<http://openresty.org>).
615
635
636
+
* The lua-resty-redis (<https://github.com/agentzh/lua-resty-redis>)
637
+
library based on the [[HttpLuaModule]] cosocket API.
638
+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4