Welcome! Log In Create A New Profile

Advanced

Redis2_pass with <host>:<port> from $args fail [maxf3r]

massimo ferrari
April 10, 2012 04:34PM
I'm trying to address several redis instances, dispatching it on a
host:port basis (one single backend location)

here part of my nginx.conf location
....
location /redis_backend {
internal;
set_unescape_uri $verb $arg_verb;
set_unescape_uri $key $arg_key;
set_unescape_uri $r_host $arg_host;
set_unescape_uri $r_port $arg_port;
redis2_query $verb $key;
redis2_pass $r_host:$r_port;
}
....

I call /redis_backend location from a lua like this:

.....
r_instance["redis_host"] = '127.0.0.1'
r_instance["redis_port"] = '33001'
.....
local res = ngx.location.capture (
"/redis_backend",
{ args =
{ verb = r_verb,
key = redis_key,
host = r_instance["redis_host"],
port = r_instance["redis_port"],
}
}
)
....

in nginx error log (i use the openresty suite ngx_openresty/1.0.10.44), I
got this error

*2012/04/07 19:25:03 [error] 11715#0: *1 redis2: upstream "127.0.0.1:33001"
not found, client: 127.0.0.1, server: ....*

I'm sure redis instance is up&running. I'm able to connect to her via
redis-cli or, simply setting redis2_pass 127.0.0.1:33001;

ciao
massimo
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Redis2_pass with <host>:<port> from $args fail [maxf3r]

massimo ferrari April 10, 2012 04:34PM

Re: Redis2_pass with <host>:<port> from $args fail [maxf3r]

agentzh April 11, 2012 11:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 186
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready