Welcome! Log In Create A New Profile

Advanced

subrequests - huge body, mirror response from proxy_pass

March 06, 2020 11:13AM
Hi all.
I want to mirror a response from 'proxy_pass` backend. I need to send it not only back to a client but also to one more service.
I was thinking to make it by subrequest in a filter module.

There is a problem with sending subrequest body.
1) I can get a response body by 'ngx_http_read_client_request_body' or
2) I can wait for the last chain in a filter body and just save all body chunks.
and then send it as a subrequest body.
Both approaches work.

But the problem is that some response bodies are big(several Gb),
and keep whole body in RAM is not efficient.

Is there a way to send subrequest body gradually by chunks in the process of receiving them from 'proxy_pass' backed ? I need smthg like ngx_http_proxy_module does when it is sending a response to an upstream but for subrequest.
Any ideas? Thanks.
Subject Author Posted

subrequests - huge body, mirror response from proxy_pass

v_label March 06, 2020 11:13AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 316
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready