nginx config:
server {
location /t1 {
rewrite ^/t1/(.*) /$1 break;
proxy_pass http://192.168.4.1:9000/;
}
location /t2 {
rewrite ^/t2/(.*) /$1 break;
proxy_pass http://192.168.4.2:9001/;
}
location / {
local uri = ngx.var.uri
local res1, res2 = ngx.location.capture_multi{
{ “/t1"..uri, {method=ngx.HTTP_POST}},
{ “/t2"..uri, {method=ngx.HTTP_GET}},
}
for k, v in ipairs(res1.header) do
ngx.say(k, v)
end
}
}
Question:
the res1.header is nil. I want to know why? and how can i get the headers of both requests. 3q