you can use sendfile to achieve this,
send to backend B first, set the x-accell-redirect header, which then should point to the location of backend A
for example we use this pattern for authentication, additionally you can omit the request body and rewrite the method used to access backend b
location ^~ "/_backendB" {
proxy_connect_timeout 1;
proxy_pass http://backendB;
proxy_intercept_errors on;
proxy_method GET;
proxy_pass_request_body off;
proxy_set_header Content-Length '0';
rewrite /_backendB(.*) $1;
internal;
break;
}