Closed atsuoishimoto closed 1 year ago
Hi, Could you share you configuration with this?
curl --unix-socket /usr/local/var/run/unit/control.sock http://localhost/config
I wonder if the "setting" object exists.
@hongzhidao I suspect the same. In which case, this will work:
curl -X PUT -d '{"js_module": "http"}' --unix-socket /usr/local/var/run/unit/control.sock http://localhost/config/settings
Unit won't automatically create parent nodes in the configuration structure.
@hongzhidao Just as you guessed, the "settings" is not exists.
curl --unix-socket /usr/local/var/run/unit/control.sock http://localhost/config
{
"listeners": {},
"applications": {}
}
@lcrilly It works! I didn't expect to be able to make the key.
Thank you both very much.
I tried to register a JS module following the instructions at https://unit.nginx.org/scripting/, but an error occurs.
I can upload the module just fine.
But I cannot add the module name to settings/js_module.
I tried with Linux and macOS
Linux
Installed from https://packages.nginx.org/unit/debian/
macOS
Installed with brew