Welcome! Log In Create A New Profile

Advanced

Re: Subrequest without returning to nginx

Dipl. Ing. Sergey Brester
May 04, 2021 11:04AM
What do you mean as "return to nginx"? Or with other words why it should
not? Or how you need to guarantee that a subrequest would take place at
all and will be considered on another side?

As for njs and "it also returns to nginx", either I don't really
understand your approach or you simply missed the word "detached" in my
answer (and njs subrequest documentation).

04.05.2021 16:49, Alfred Sawaya wrote:

> 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:
>
> Hi,
>
> see how the directive mirror [2] or post_action doing this.
>
> Also take a look at njs [3], how it can make a detached subrequest.
>
> Regards,
> Serg.
>
> 04.05.2021 16:11, Alfred Sawaya wrote:
>
> Hello,
>
> 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.
>
> Thanks,
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel [1]


Links:
------
[1] http://mailman.nginx.org/mailman/listinfo/nginx-devel
[2] https://nginx.org/en/docs/http/ngx_http_mirror_module.html
[3] http://nginx.org/en/docs/njs/reference.html
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Subrequest without returning to nginx

Alfred Sawaya 297 May 04, 2021 10:12AM

Re: Subrequest without returning to nginx

Dipl. Ing. Sergey Brester 89 May 04, 2021 10:34AM

Re: Subrequest without returning to nginx

Alfred Sawaya 87 May 04, 2021 10:50AM

Re: Subrequest without returning to nginx

Dipl. Ing. Sergey Brester 80 May 04, 2021 11:04AM

Re: Subrequest without returning to nginx

Alfred Sawaya 106 May 04, 2021 11:16AM

Re: Subrequest without returning to nginx

Ranier Vilela 102 May 04, 2021 10:36AM

Re: Subrequest without returning to nginx

Alfred Sawaya 96 May 04, 2021 11:00AM

Re: Subrequest without returning to nginx

Maxim Dounin 86 May 04, 2021 11:00AM

Re: Subrequest without returning to nginx

Alfred Sawaya 134 May 04, 2021 11:26AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 244
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