How to reload and restart Nginx

 

Overview

You can reload or restart Nginx from your panel or via SSH. Do this after changing a configuration file to make sure the new settings take effect.

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 do I 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.

How do I reload Nginx in the panel (VPS and Dedicated Servers)?

To reload your server in the panel:

  1. Navigate to the Servers & Usage page.
  2. Click the 'vertical 3 dots' button to the right of the server you wish to reload.
  3. Click the Reload HTTP button.
  4. Wait 5 minutes for it to rebuild the configuration file.

How do I reload Nginx 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 do I restart Nginx?

The following sections explain how to restart Nginx from either the panel or via SSH.

How do I restart Nginx in the panel (VPS and Dedicated Servers)?

To restart your server in the panel:

  1. Navigate to the Servers & Usage page.
  2. Click the 'vertical 3 dots' button to the right of the server you wish to restart.
  3. Click the Restart Server button.
  4. Wait 5 minutes for it to rebuild the configuration file.

How do I restart Nginx 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

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?