Answer the question
In order to leave comments, you need to log in
How to make synchronous subrequests in Nginx + NJS?
Good day.
There is Nginx, it already has some simple njs scripts. There is a task to check the token (from the headers) on a third-party service and the desire to do it on the same njs (it has off-line support, and I don’t want to put something else, especially third-party). The essence of the check is simple - if the token is not valid - 403, otherwise - proxy_pass.
But the catch is that the subrequest is executed asynchronously and the result of its request as the result of the work of the entire function cannot be used. Has anyone faced a similar issue?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question