请问由于backend的API既有POST,又有GET,这个时候怎么处理?
location @proxy_test {
content_by_lua '
ngx.req.read_body()
local data = "">
local args = ngx.req.get_uri_args()
local res = ngx.location.capture("/backend", {method=ngx.HTTP_POST, body=data, args=args})
ngx.say(res.body)
';
}
location /backend {
internal;
proxy_pass http://127.0.0.1:8001$request_uri;
proxy_redirect off;
}