How to reload and restart Nginx (Dedicated servers only)

This article contains information/examples using root/sudo/admin users. If you require sudo/admin access, you must upgrade to a Dedicated server.

Reloading

Anytime you make a change to a configuration file, you should reload Nginx. You can do this by logging into your server via SSH with your admin user. Then, run the following command:

[server]$ sudo /etc/init.d/nginx reload
  • Reloading keeps the server running while re-reading any configuration file updates.
  • Reloading is safer than restarting because if a syntax error is noticed in a config file, it will not proceed with the reload and your server remains running.
  • If there is a syntax error in a config file and you restart, it's possible the server will not restart correctly.

Restarting

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

You can also restart in your DreamHost panel. Navigate to the (Panel > 'VPS' > 'Dashboard') page, and then click the Restart button to the right of your server.

See also

Did this article answer your questions?

Article last updated .