location中使用set_by_lua或rewrite_by_lua
来源:4-16 基于Nginx的HTTPS服务_HTTPS原理和作用1
无名点
2020-01-13
我在location中使用set_by_lua或rewrite_by_lua时,出现了下面的异常,
我想要在location中通过读取redis数据动态的去设置代理地址,就出现了下面的问题,这个问题该怎么解决呢?
context of set_by_lua*
stack traceback:
[C]: in function ‘tcp’
/usr/local/openresty/lualib/resty/redis.lua:60: in function ‘new’
/usr/local/openresty/nginx/a.lua:3: in main chunk, client: 223.104.160.58, server: localhost, request: “GET / HTTP/1.1”, host: "120.7
2020/01/13 15:36:28 [error] 25213#25213: *295 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/redis.lua:240: bad argument #1 to ‘rawget’ (table expected, got string)
stack traceback:
coroutine 0:
[C]: in function ‘rawget’
/usr/local/openresty/lualib/resty/redis.lua:240: in function 'get’
rewrite_by_lua(nginx.conf:133):13: in main chunk, client: 223.104.160.58, server: localhost, request: “GET / HTTP/1.1”, host: “120.79.175.190”
2回答
-
Jeson
2020-01-15
bad argument---------
1、/resty/redis.lua:240 看看请求的参数是否有问题?
2、手动通过rawget 请求下,是否可以获取到数据。
012020-01-16 -
无名点
提问者
2020-01-13
get异常以解决,set_by_lua连接redis异常还是没有解决
00
相似问题
回答 1
回答 1