-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I am trying to use eval with the redis2 nginx plugin. I want to get the backend server name from redis.
I am trying with this:
location / {
eval_escalate on;
eval $answer {
redis2_raw_query 'get server_name\r\n';
eval_override_content_type text/plain;
redis2_query get server_name;
redis2_pass 127.0.0.1:6379;
}
proxy_pass $answer;
But that doesn't work because the redis response has the string length at the beginning of the response. So you get:
2010/12/28 17:05:34 [error] 52979#0: *73 invalid URL prefix in "$24
http://127.0.0.1/foo//" while sending to client, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"
Any ideas?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels