-
Notifications
You must be signed in to change notification settings - Fork 410
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 does not reload when adding a site, enabling a site, or disabling a site #222
Comments
Can you provide the logs? |
This issue ouccurs also with me, since latest relese of to v2.0.0-beta.5 - so it is probably located in that changes. No log access at the moment from my side, sorry. Running this through docker hub. |
When the operation all succeeded and there was no error log from Nginx. |
ok, I will try to fix it as soon as possible. |
I fixed in 7c6b4fe. It works fine in my docker container, can you test this version, as I'm not sure it can also work well in your environment. |
I have tested your fix and the Reload command works fine when add, disable, and enable site. However, I discovered a new problem with the Nginx restart in the Nginx Control menu To test I did the following. First I stopped Nginx
then used Restart Nginx on menu But, When I check Nginx's status it is actually inactive Next I tried checking the listen port to see why Nginx UI reported Nginx running. Then I see that there is an Nginx process running and listening to port 80
This problem will not occur when I restart Nginx directly from the server. |
In this verison, I use two separate commands to restart nginx. nginx-ui/internal/nginx/nginx.go Lines 59 to 61 in 7c6b4fe
When you click the reload button in nginx-ui, it attempts to stop nginx whether it's running or not, that's why the error message appears if nginx is already stopped. To address this, I should check the running status of nginx before attempting to stop it. The second problem is when starting a process without using systemtl (or services). I you use systemtl status to check the running status, it will always report inactive. To reproduce this, you can execute And you might notice that I use this method to restart nginx in the Line 59 to 61 in |
Unfortunately, start-stop-daemon takes not effect on this issue, you have to config a nginx restart command in nginx-ui configuration file, app.ini. |
yes, i tried use RestartCmd configuration and it worked perfectly. i also tried start-stop-daemon command
then the result when using start-stop-daemon is the same as using nginx -s. And if using start-stop-daemon forces users to install everything by default and will not be able to customize the path of nginx binary or pid file location. I think using app.ini configuration will be the perfect solution. |
If you don't mind, I have one more small question. I run nginx-ui by default, and it automatically creates the app.ini file. And I see the configuration in the app.ini file ( [server] and [nginx] ) [server] [nginx] Is there any difference between these two configurations? |
😂 This is a breaking change since v2.0.0-beta.3, https://github.com/0xJacky/nginx-ui/releases/tag/v2.0.0-beta.3
|
Describe the bug
To Reproduce
I tried both the pre-built binary version and the build from source and both failed. Binary download link and Source I used:
Info:
The text was updated successfully, but these errors were encountered: