I found a section on the nginx docs that you can use
ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions
to extend nginx. As use case
Complex access control and security checks in njs before a request reaches an upstream server
https://nginx.org/en/docs/njs/
No i wonder if im able to connect to a database and do something similar as in node.js. Or even "run" node inside of the nginx process. But I think I have bad cards because there are currently only two modules, which provide no functionality like network sockets, but, there is a section "Using node modules with njs": https://nginx.org/en/docs/njs/node_modules.html.
Works this only with externeal libs or also with "node internals" like net, dgram, etc.?