Closed WSandwitch closed 3 months ago
sub_request method was currently supported in the set, rewrite, and access handlers. For example:
location /sub_req_proxy_pass {
proxy_pass http://127.0.0.1:48080/mruby;
mruby_output_body_filter_code '
a = 1
';
}
# non-blocking http client
location /async_http_sub_request_with_proxy_pass {
mruby_rewrite_handler_code '
Nginx::Async::HTTP.sub_request "/sub_req_proxy_pass"
res = Nginx::Async::HTTP.last_response
Nginx.rputs res.body
';
}
I have this locations in nginx.conf:
I try to get response from /test3 but with no success:
But /test3/subrequest works ok:
What am I doing wrong?