nginx-ui icon indicating copy to clipboard operation
nginx-ui copied to clipboard

Enhancement Request: Add "systemctl restart nginx" button

Open LucaNerlich opened this issue 5 years ago • 9 comments

It would be great, if someone could add a button which executes systemctl restart nginx on the underlying machine. Then everything nginx related could be handled via this ui.

As of right now, I need to edit something AND login via ssh and restart nginx for the changed to come into effect.

Thanks for the great work so far :)

LucaNerlich avatar Jun 24 '20 09:06 LucaNerlich

Wouldn't nginx reload make more sense? This would make sure you don't end up with a nginx that won't start because of syntax errors.

TheFehr avatar Jun 24 '20 11:06 TheFehr

Well, ideally youd build the output of ‚nginx -t‘ into the you as well. Or add a button ‚check‘ and restart/reload afterwards.

True, good point.

LucaNerlich avatar Jun 24 '20 11:06 LucaNerlich

nginx -s reload would be ideal, to make sure nginx falls back if the new configuration fails.

kennyparsons avatar Jun 24 '20 14:06 kennyparsons

nginx -s reload would be ideal, to make sure nginx falls back if the new configuration fails.

But for any of this to work the nginx binary will need to be mounted into the container.

TheFehr avatar Jun 24 '20 15:06 TheFehr

Hello @LucaNerlich, thank you very much for your issue. You're right, of course. The feature is important and will come. The goal for the next release is to manage multiple nginx instances. Since there are environments where nginx is running on both bare-metal and docker, I am looking for a good solution to cover both. I imagine that when integrating an nginx instance into nginx ui the type of the instance is specified (baremetal/docker).

schenkd avatar Jun 25 '20 09:06 schenkd

To execute a command on non-dockerized nginx from inside a docker container is going to be tricky / hacky. Im unsure myself, on how a good solution would look like.

LucaNerlich avatar Jun 25 '20 09:06 LucaNerlich

To execute a command on non-dockerized nginx from inside a docker container is going to be tricky / hacky. Im unsure myself, on how a good solution would look like.

My approach would be an SSH connection to the server with the necessary permissions to trigger a reload from nginx. The access data would then have to be stored in the form of a user management system. This would also allow the infrastructure to ensure that everyone is only allowed to do what the admin allows. :)

Best David

schenkd avatar Jun 25 '20 10:06 schenkd

I've been pitching this tool at my workplace and this is the main feature stopping us from using it right now.

rzabarazesh avatar Jun 26 '20 18:06 rzabarazesh