local action = ngx.var.request_method;
ngx.req.read_body();
local data = ngx.req.get_body_data();
local args = ngx.req.get_uri_args();
local httpmethod = ngx.req.get_method();
local res ;
if ngx.req.get_method()=="GET" then
res = ngx.location.capture("/sub1"..ngx.var.request_uri,{method=ngx.HTTP_GET,body= data})
else
res = ngx.location.capture("/sub1"..ngx.var.request_uri,{method=ngx.HTTP_POST,body= data})
end
ngx.status=res.status
for k,v in pairs(res.header) do
ngx.header[k]=v
end
ngx.print(res.body)