Closed stefkkkk closed 3 months ago
Hi @stefkkkk,
Thanks for getting in touch. Unit already has this capability, see the documentation on https://unit.nginx.org/controlapi/#api-manipulation, and the example with the text To get the complete /config section:
Send a GET request at the control api /config
route.
Hope this helps :)
Hi @stefkkkk,
Thanks for getting in touch. Unit already has this capability, see the documentation on https://unit.nginx.org/controlapi/#api-manipulation, and the example with the text
To get the complete /config section:
Send a GET request at the control api
/config
route.Hope this helps :)
I mean the same behaviour as in classic nginx, I exactly don't want to use API, instead I want to mount config and unitd deamon will read this config from the file
I don't think that was the question.
I think they more wanted to know if Unit could read an existing config file from the filesystem.
Yes, it can and does, you can place a config file into
$(STATEDIR)/conf.json
See unitd --version
for where the --statedir
points to.
The caveat is I don't think we make any guarantees about the stability of the mechanism. But it's worked up to now, and I don't see any real reason to break it...
I don't think that was the question.
I think they more wanted to know if Unit could read an existing config file from the filesystem.
Yes, it can and does, you can place a config file into
$(STATEDIR)/conf.json
See
unitd --version
for where the--statedir
points to.The caveat is I don't think we make any guarantees about the stability of the mechanism. But it's worked up to now, and I don't see any real reason to break it...
Yeap, it works, thanks a lot for such quick reply! May be make sense to add this into documentation?
Yeap, it works, thanks a lot for such quick reply! May be make sense
You're welcome.
to add this into documentation?
I think the reason it's not documented is the caveat I mentioned...
Maybe this is something we'll revisit one day...
Hi! Have you any plans about to give an opportunity to read mounted config files? Not only update/upload it via API.