-
Notifications
You must be signed in to change notification settings - Fork 331
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
Nginx Unit --state saving multiple json configs on service restarts #48
Comments
This state directory isn't a configuration storage. It was introduced just for runtime configuration persistence in order to allow Unit to survive server reloads without additional tricks. It's up to you where to store and how to manage your configurations. |
i see but even if i do not restart unitd service, i can only list the last added
unitd.log
|
They are gone not because of the reload. When you do |
hmm the docs at isn't exactly clear on this http://unit.nginx.org/docs-configuration.html#creating-configuration-objects we have to separately add the listener and applications from separate json files ? |
There are 3 methods supported at the moment: |
You can add an application and then a listener, thus with two requests. For now, there's only one way to add both a listener and an application with just one request: by uploading the full resulting configuration to the root Support for the |
I also can suggest a nice and very powerful utility for operating with JSON:
|
And you can merge JSON files with it:
|
cheers but don't we need to define the actual listener
if contents of
for
and for
for
?? |
Yes, you have to define it in URI: |
cheers so
lots to digest.. thanks Hope this info makes it into official documentation manual too :) |
Merging with
|
@VBart thanks merging seems easier to do as I can script it to read all .json files within a config directory for merging :)
though getting 405 not allowed error
|
That error comes from nginx, not unit. =) Note, that I used |
thanks for the hint added the control socket back
|
If you have the modules collection that you mentioned in #47, then |
ah ha thanks @VBart needed that second set of eyes :)
|
I source compiled Nginx Unit on CentOS 7.4 64bit using configure options
I assumed the
--state
option would save all loaded configurations as when I tested with just a single/root/tools/unitconfigs/php5631start.json
loaded, a unitd service restart reloaded the config ok. But when I loaded more php configurations listed below, on unitd service restart, only the last loaded config was restored for/root/tools/unitconfigs/php720start.json
?5.6.31
/root/tools/unitconfigs/php5631start.json
7.0.24
/root/tools/unitconfigs/php7024start.json
7.1.10
/root/tools/unitconfigs/php7110start.json
7.2.0
/root/tools/unitconfigs/php720start.json
but only the last config was restored on unitd service restart
The text was updated successfully, but these errors were encountered: