How to gracefully restart nginx after SSL certificate update


Recommended Posts

I know this has been asked before but I'm finding the previous / older provided solutions are causing instability.  Let me explain.

I'm using a wildcard cert from LetsEncrypt.  As you probably know, letsencrypt certs have a fairly short expire time.  I'm using SWAG to grab the certs and a custom script to check for new certs from SWAG and copy them to the various places they need to go, including `/boot/config/ssl/certs`  
The problem is that either NGINX or PHP doesn't pick up the new certs until they are restarted.  
Here's what I was running:
 

    # Restart Unraid WebGUI
    echo "Reloading Unraid NGINX for the WebUI"
    # Below command might have been casuing issues with the server, processes kept getting killed and restarted.
    /etc/rc.d/rc.nginx reload
    # Commented out for now, broke on unraid upgrade, research later
    /etc/rc.d/rc.nginx restart
    /etc/rc.d/rc.php-fpm restart

 

I've uncommented the three commands above, but in my script they are currently commented out.

 

So I'm asking if someone working on the Unraid project has the official way we should be doing this so I don't feel like I'm doing something that could break my NAS.

 

If we can get an official answer, maybe adding it to the below would be good.
https://wiki.unraid.net/Manual/Security#Securing_webGui_connections_.28SSL.29

Link to comment
  • 3 months later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.