comparison xml/en/docs/http/ngx_http_js_module.xml @ 2784:65591dd31d64

Updated Example Configuration in ngx_http_js_module.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 19 Oct 2021 15:12:08 +0100
parents b6bbdce8c659
children 005b056c267f
comparison
equal deleted inserted replaced
2783:87713cb4be56 2784:65591dd31d64
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8 8
9 <module name="Module ngx_http_js_module" 9 <module name="Module ngx_http_js_module"
10 link="/en/docs/http/ngx_http_js_module.html" 10 link="/en/docs/http/ngx_http_js_module.html"
11 lang="en" 11 lang="en"
12 rev="31"> 12 rev="32">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 The <literal>ngx_http_js_module</literal> module is used to implement 17 The <literal>ngx_http_js_module</literal> module is used to implement
38 js_import http.js; 38 js_import http.js;
39 39
40 js_set $foo http.foo; 40 js_set $foo http.foo;
41 js_set $summary http.summary; 41 js_set $summary http.summary;
42 js_set $hash http.hash; 42 js_set $hash http.hash;
43
44 resolver 10.0.0.1;
43 45
44 server { 46 server {
45 listen 8000; 47 listen 8000;
46 48
47 location / { 49 location / {
122 r.return(200, "Hello world!"); 124 r.return(200, "Hello world!");
123 } 125 }
124 126
125 // since 0.7.0 127 // since 0.7.0
126 async function fetch(r) { 128 async function fetch(r) {
127 let results = await Promise.all([ngx.fetch('http://nginx.org/'), 129 let results = await Promise.all([ngx.fetch('https://nginx.org/'),
128 ngx.fetch('http://nginx.org/en/')]); 130 ngx.fetch('https://nginx.org/en/')]);
129 131
130 r.return(200, JSON.stringify(results, undefined, 4)); 132 r.return(200, JSON.stringify(results, undefined, 4));
131 } 133 }
132 134
133 // since 0.7.0 135 // since 0.7.0