nginx auth_request_set不允许在上下文中测试变量
我正在寻找fcgi授权人的解决方案,以下是我的测试配置:nginx auth_request_set不允许在上下文中测试变量,nginx,fastcgi,auth-request,Nginx,Fastcgi,Auth Request,我正在寻找fcgi授权人的解决方案,以下是我的测试配置: location ~* "f4m$" { limit_except GET { deny all; } auth_request /clu; auth_request_set $node $upstream_http_server; # Proble
location ~* "f4m$" {
limit_except GET {
deny all;
}
auth_request /clu;
auth_request_set $node $upstream_http_server;
# Problem's that $node is always empty for <if> in this context
proxy_set_header Node $node;
proxy_pass http://127.0.0.1/group_1tv$request_uri;
}
location = /clu {
internal;
proxy_pass_request_body off;
proxy_pass_request_headers off;
proxy_set_header Content-Length '';
proxy_pass http://cluster_authorizer$request_uri;
}
}
不幸的是,同样,这只在$http_节点为非空且返回400(未知位置)时才起作用,调试日志没有解释为什么:
2014/02/02 18:31:15 [debug] 9602#0: *18 http upstream request: "/hds-live/livepkgr/_definst_/1tv.f4m?r=334"
2014/02/02 18:31:15 [debug] 9602#0: *18 http upstream process header
2014/02/02 18:31:15 [debug] 9602#0: *18 malloc: 09C12AD8:4096
2014/02/02 18:31:15 [debug] 9602#0: *18 recv: fd:12 137 of 4096
2014/02/02 18:31:15 [debug] 9602#0: *18 http proxy status 400 "400 Unknown location"
我花了整整两天的时间在这上面,真的需要一个新的输入…所以我用内部代理解决了我自己的一个400问题,因为我将内容长度设置为无效设置(“”),而不是0 删除此项:
代理集标题内容长度“” 主要的问题是,我必须更改上下文(proxy_pass)以实现变量(auth_request_set$node),这不是预期的行为。。。谢谢你告诉我大约400美元。
2014/02/02 18:31:15 [debug] 9602#0: *18 http upstream request: "/hds-live/livepkgr/_definst_/1tv.f4m?r=334"
2014/02/02 18:31:15 [debug] 9602#0: *18 http upstream process header
2014/02/02 18:31:15 [debug] 9602#0: *18 malloc: 09C12AD8:4096
2014/02/02 18:31:15 [debug] 9602#0: *18 recv: fd:12 137 of 4096
2014/02/02 18:31:15 [debug] 9602#0: *18 http proxy status 400 "400 Unknown location"