Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_js_module.xml @ 1858:36cbfff92c6d
Restricted context of js_set directive to http and stream only.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 13 Dec 2016 17:28:36 +0300 |
parents | 8868945bbe97 |
children | 621daf1b77d0 |
comparison
equal
deleted
inserted
replaced
1857:0882ccb0c00f | 1858:36cbfff92c6d |
---|---|
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="3"> | 12 rev="4"> |
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 |
56 | 56 |
57 <para> | 57 <para> |
58 <example> | 58 <example> |
59 js_include http.js; | 59 js_include http.js; |
60 | 60 |
61 js_set $foo foo; | |
62 js_set $summary summary; | |
63 | |
61 server { | 64 server { |
62 listen 8000; | 65 listen 8000; |
63 | 66 |
64 location / { | 67 location / { |
65 js_set $foo foo; | |
66 add_header X-Foo $foo; | 68 add_header X-Foo $foo; |
67 js_content baz; | 69 js_content baz; |
68 } | 70 } |
69 | 71 |
70 location /summary { | 72 location /summary { |
71 js_set $summary summary; | 73 return 200 $summary; |
72 return 200 $summary; | |
73 } | 74 } |
74 } | 75 } |
75 </example> | 76 </example> |
76 </para> | 77 </para> |
77 | 78 |
157 <directive name="js_set"> | 158 <directive name="js_set"> |
158 <syntax> | 159 <syntax> |
159 <value>$variable</value> <value>function</value></syntax> | 160 <value>$variable</value> <value>function</value></syntax> |
160 <default/> | 161 <default/> |
161 <context>http</context> | 162 <context>http</context> |
162 <context>server</context> | |
163 <context>location</context> | |
164 | 163 |
165 <para> | 164 <para> |
166 Sets an nginScript function for the specified variable. | 165 Sets an nginScript function for the specified variable. |
167 </para> | 166 </para> |
168 | 167 |