NGINX Modern Apps > Class 3 - NGINX Dataplane Scripting Source | Edit on
Subrequests chaining [http/subrequests_chaining]¶
Chaining subrequests allows us to use the output of one subrequest as the input to another.
Step 1: Use the following commands to start your NGINX container with this lab’s files:
Step 2: Now let’s use curl to test our NGINX server:
Code Snippets¶
Notice how this config uses location blocks to define the target of each subrequest.
This njs code retrieves a token from the “/auth” location and then passes the token to a second subrequest of the “/backend” location.