Mercurial > hg > nginx-site
diff xml/ru/docs/http/ngx_http_js_module.xml @ 2190:dfc49994218c
Updated example in HTTP njs module.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 19 Jun 2018 20:43:33 +0300 |
parents | 523dc4cc8745 |
children | 5cacd6fffade |
line wrap: on
line diff
--- a/xml/ru/docs/http/ngx_http_js_module.xml +++ b/xml/ru/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ <module name="Модуль ngx_http_js_module" link="/ru/docs/http/ngx_http_js_module.html" lang="ru" - rev="13"> + rev="14"> <section id="summary"> @@ -33,21 +33,30 @@ <para> <example> -js_include http.js; +load_module modules/ngx_http_js_module.so; +... + +http { + js_include http.js; -js_set $foo foo; -js_set $summary summary; + js_set $foo foo; + js_set $summary summary; -server { - listen 8000; + server { + listen 8000; - location / { - add_header X-Foo $foo; - js_content baz; - } + location / { + add_header X-Foo $foo; + js_content baz; + } - location /summary { - return 200 $summary; + location /summary { + return 200 $summary; + } + + location /hello { + js_content hello; + } } } </example> @@ -97,6 +106,10 @@ function baz(r) { r.finish(); } + +function hello(r) { + r.return(200, "Hello world!"); +} </example> </para>