Subrequest without returning to nginx
alfred at huji.fr
Tue May 4 14:49:06 UTC 2021
mirror and post_action both return to nginx to complete the subrequest.
njs also does an event-driven subrequest (ie gives back a promise and
set a callback), so it also returns to nginx to complete the subrequest.
On 04/05/2021 16:32, Dipl. Ing. Sergey Brester wrote:
> see how the directive mirror
> <https://nginx.org/en/docs/http/ngx_http_mirror_module.html> or
> |post_action| doing this.
> Also take a look at njs <http://nginx.org/en/docs/njs/reference.html>,
> how it can make a detached subrequest.
> 04.05.2021 16:11, Alfred Sawaya wrote:
>> I am currently converting an Apache module to Nginx. This module uses
>> subrequests and needs (for now) to execute the subrequest without
>> unwinding the stack (ie without returning to nginx).
>> I tried to call ngx_http_run_posted_requests by hand, but it does not
>> work as the upstream socket needs to get polled some time.
>> So I wonder, is there any way to do this ?
>> Of course I know that I shouldn't do it like this, but the current
>> module is not reentrant and poorly architectured. I will eventually
>> refactor it but later.
>> nginx-devel mailing list
>> nginx-devel at nginx.org <mailto:nginx-devel at nginx.org>
>> http://mailman.nginx.org/mailman/listinfo/nginx-devel <http://mailman.nginx.org/mailman/listinfo/nginx-devel>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx-devel