I write the sample nginxscript.
I wrote the line
req.log("hello from foo() handler");
But I can't find the log file, do you know the path of the log file or any document to guide to enable log message, thanks.
js_include http.js;
server {
location /hello {
js_set $foo foo;
add_header X-Foo $foo;
js_content baz;
}
}
https.js
function foo(req, res) {
req.log("hello from foo() handler");
return "foo";
}
function baz(req, res) {
res.headers.foo = 1234;
res.status = 200;
res.contentType = "text/plain; charset=utf-8";
res.contentLength = 15;
res.sendHeader();
res.send("nginx");
res.send("java");
res.send("script");
res.finish();
}