Overview
This article explains how to reload and restart Nginx in your panel or via SSH. This is recommended after making a change to a configuration file to ensure the new settings are used.
This article contains examples using sudo/admin users. If you require sudo/admin access, you must upgrade to a Dedicated Server and add an admin user.
How to reload Nginx
Reloading is recommended as it keeps the server running while re-reading any configuration file updates. This is safer than restarting because if a syntax error is noticed in a config file, it will not proceed with the reload, allowing your server to remain running.
- If you instead restart with a syntax error, your server may potentially not restart correctly.
Reloading in the panel (VPS and Dedicated Servers)
To reload your server in the panel:
- Navigate to the VPS page.
- Click the 'vertical 3 dots' button to the right of the server you wish to reload.
- Click the Reload HTTP button.
- Wait 5 minutes for it to rebuild the configuration file.
Reloading via SSH (Dedicated Servers only)
You can restart Nginx with the following command after logging into your server via SSH with your admin user:
[server]$ sudo /etc/init.d/nginx reload
How to restart Nginx
The following sections explain how to restart Nginx from either the panel or via SSH.
Restarting in the panel (VPS and Dedicated Servers)
To restart your server in the panel:
- Navigate to the VPS page.
- Click the 'vertical 3 dots' button to the right of the server you wish to restart.
- Click the Restart Server button.
- Wait 5 minutes for it to rebuild the configuration file.
Restarting via SSH (Dedicated Servers only)
You can restart Nginx with the following commands after logging into your server via SSH with your admin user:
[server]$ sudo /etc/init.d/nginx stop [server]$ sudo /etc/init.d/nginx start