-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to run a shell command #10
Comments
Hello, could you please clarify what do you mean? An example will be perfect. Thanks, Maxim |
For example, something like this: function ssl_vers(req, res) {
return os.exec("/usr/local/bin/openssl version");
} and js_include http.js;
js_set $ssl_vers ssl_vers;
server {
listen 8000;
location /ssl_vers {
return 200 $ssl_vers;
}
} |
Issam, Thanks for clarification. Unfortunately I must confirm that this is no-go simple because njs is intended to be a supplementary tool for njs code development that runs inside nginx. And nginx won't be able to run external programs for any foreseeable future. |
Well, thank you for having at least considered my request. I totally understand your point. |
Is this still the case? There is a lot of limitations if we can't execute shell commands, for example I'm trying to migrate from openresty to njs, but this limitation makes it impossible to migrate. I could, in theory, create a node.js server that accepts shell commands as HTTP requests, but that's unnecessary extra work :/ |
I use nginx+fcgi as workaround if it helps. fcgi should be more lightweight than an extra nodejs server as backend. |
Hi. It would be really useful if we were able to execute a shell command and return the output. I don't think it's possible right now, not at my knowledge at least.
Thank you.
The text was updated successfully, but these errors were encountered: