September 14, 2016 02:14AM
On 14 Sep 2016, at 05:32, George <nginx-forum@forum.nginx.org> wrote:

> even
>
>
> location /njs {
> js_run "
> var res;
> res = $r.response;
> res.status = 200;
> res.send('Hello World!');
> res.finish();
> ";
> }
>
> gives an error
>
> nginx -t
> nginx: [emerg] unknown directive "js_run" in
> /usr/local/nginx/conf/conf.d/virtual.conf:36
> nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

Interface has been changed.

Now you should define a function in a file:

function hw(req, res) {
var res;
...
}

Then include the file with

js_include file.js;

Then use the function to generate content:

location /njs {
js_content hw;
}


--
Igor Sysoev
http://nginx.com

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginScript + nginx 1.11.4, js_run unknown directive ?

George September 13, 2016 10:14PM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

Valentin V. Bartenev September 13, 2016 10:26PM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

George September 13, 2016 10:30PM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

George September 13, 2016 10:32PM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

Igor Sysoev September 14, 2016 02:14AM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

George September 14, 2016 03:34AM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

George September 13, 2016 10:35PM

Re: nginScript + nginx 1.11.4, js_run unknown directive ?

Igor Sysoev September 14, 2016 02:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 134
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready