From 8c9570dcffe62a8cfa027da408c4c0949ca8c32b Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 20 Jul 2016 21:40:34 +0300 Subject: [PATCH] Updated README. --- README | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README b/README index d8a6f91a..7b487647 100644 --- a/README +++ b/README @@ -4,13 +4,14 @@ option: ./configure --add-module=/nginx -Alternatively, you can build a dynamic version of the njs module +Alternatively, you can build a dynamic version of the modules ./configure --add-dynamic-module=/nginx -and add the following line to nginx.conf and reload nginx: +and add the following lines to nginx.conf to load them load_module modules/ngx_http_js_module.so; + load_module modules/ngx_stream_js_module.so; Please report your experiences to the NGINX development mailing list nginx-devel@nginx.org (http://mailman.nginx.org/mailman/listinfo/nginx-devel). @@ -49,6 +50,9 @@ res Example nginx.conf: + # load dynamic HTTP JavaScript module + load_module modules/ngx_http_js_module.so; + worker_processes 1; pid logs/nginx.pid; @@ -58,7 +62,7 @@ Example nginx.conf: http { # include JavaScript file - js_include js-http.js; + js_include http.js; server { listen 8000; @@ -83,7 +87,7 @@ Example nginx.conf: } -js-http.js: +http.js: function foo(req, res) { req.log("hello from foo() handler"); @@ -146,6 +150,9 @@ The following properties are available in the session object: Example nginx.conf: + # load dynamic Stream JavaScript module + load_module modules/ngx_stream_js_module.so; + worker_processes 1; pid logs/nginx.pid; @@ -155,7 +162,7 @@ Example nginx.conf: stream { # include JavaScript file - js_include js-stream.js; + js_include stream.js; server { listen 8000; @@ -171,7 +178,7 @@ Example nginx.conf: } -js-stream.js: +stream.js: function foo(s) { s.log("hello from foo() handler!"); -- 2.47.3