I'm trying to find out the njs module version that compiled within Nginx. nginx -v shows the module is there but doesn't show the version.
Is there any way to find out the version of njs module that already compiled in within Nginx?
I considered this method for installation.
Thanks.
Hi @laith-leo,
Dynamically:
njs version: njs.version
nginx version: r.variables.nginx_version
using njs CLI: njs -v
Statically for ngx_http_js_module.so
strings ./usr/lib/nginx/modules/ngx_http_js_module.so | grep -e '0\.'
U0.4.1
For pre-built packages in Ubuntu:
sudo apt install nginx-module-njs
dpkg -s nginx-module-njs
...
Version: 1.18.0.0.4.1-1~xenial
Depends: libc6 (>= 2.17), libpcre3, libreadline6 (>= 6.0), nginx (= 1.18.0-1~xenial)
...
Here 1.18.0 is nginx version, the second part 0.4.1 is njs version.
Thanks @xeioex,
These options are not really helping me, I have compiled the njs module with Nginx source code, so I don't have an njc cli neither the ngx_http_js_module.so is available.
Is there a way to determine the njs version through an API call through curl command or something? Just asking as I have hundreds of servers that I need to check which njs version is installed on each.
@laith-leo
Is there a way to determine the njs version through an API call through curl command or something?
The only option is to declare a location and return njs.version from it. There is no builtin locations in nginx.
@laith-leo
We recommend using pre-built packages, because they are tested against the nginx version they are compiled with.