Welcome! Log In Create A New Profile

Advanced

njs and subrequests

Antoine Bonavita
November 17, 2018 09:08AM
Hello,

For a pet project of mine I'm trying to use njs to retrieve data from a
number of different sources (URLs really) and assemble them into one single
response. I tried to implement a proof of concept using subrequest (from
ngx_http_js_module) to do so. I quickly realized that it works only for
internal subrequests (i.e. not to external servers).

I worked around this with the following location:
location = /fwd-proxy {
proxy_pass $arg_tgt;
}

We all know nginx is not really a forward proxy and this approach does not
seem very nice for the long term.

So, I have a few cascading questions:
1 - Is there any plan to have subrequest from ngx_http_js_module support
external URLs ?
2 - If answer to 1 is no, is there any plan to have another official js
module implement it ?
3 - If no, what would make most sense: implement it as a 3rd-party module
or completely move to something different (nginx Unit with Node.js comes to
mind) ? And why one rather than the other ?

Thank you for reading so far and evne more thanks if you are kind enough to
hit the reply button.

A.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

njs and subrequests

Antoine Bonavita November 17, 2018 09:08AM

Re: njs and subrequests

Valentin V. Bartenev November 17, 2018 10:18AM

Re: njs and subrequests

Antoine Bonavita November 18, 2018 10:08AM

Re: njs and subrequests

Valentin V. Bartenev November 22, 2018 03:12PM

Re: njs and subrequests

Antoine Bonavita November 26, 2018 04:32AM

Re: njs and subrequests

Dmitry Volyntsev November 19, 2018 08:30AM

Re: njs and subrequests

Antoine Bonavita November 21, 2018 02:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready