1
xoxo 2014-05-13 11:42:02 +08:00
|
2
LazyZhu 2014-05-13 12:25:44 +08:00
我记得好像不行吧,ngx.location.capture / ngx.socket 是不能在 set_by_lua 里面用的
|
3
fghzpqm 2014-05-13 19:24:47 +08:00
不行,set_by_lua 是运行在 rewrite 阶段,并且:
『This directive is implemented by injecting custom commands into the standard HttpRewriteModule's command list. Because HttpRewriteModule does not support nonblocking I/O in its commands, Lua APIs requiring yielding the current Lua "light thread" cannot work in this directive.』 http://wiki.nginx.org/HttpLuaModule#set_by_lua |
4
Livid MOD OP 貌似今天刚刚发布的 1.7.1 里可以了:
http://nginx.org/en/docs/http/ngx_http_upstream_module.html $upstream_cookie_name cookie with the specified name sent by the upstream server in the “Set-Cookie” response header field (1.7.1). Only the last server’s response header fields are saved. 一会试验一下。 |