原有系统将每天夜里生成的验证码图片缓存起来,现在想尝试通过 lua +nginx直接读取图片返回,报错,春哥能看下么?非常感谢
lua entry thread aborted: runtime error: [string "content_by_lua"]:12: attempt to perform arithmetic on a string value
stack traceback:
coroutine 0:
[string "content_by_lua"]: in function <[string "content_by_lua"]:1>, client: 192.168.122.1, server: www.ngxtest.com, request: "GET /testredisimg HTTP/1.1", host: "192.168.122.130"
local ok,err = instance:connect("192.168.230.44","15231");
if not ok then
ngx.log(ngx.ERR,err);
ngx.exit(ngx.HTTP_SERVICE_UNAVAILABLE);
end
local vcodestr = instance:srandmember("vc:ENGLISH_WORD420130808");
local image = instance:getbit("vc:"+vcodestr)
instance:close();
ngx.say(image)