Nginx is one of the most popular reverse proxy server used in the tech industry.
If you have hosted an nginx server on a Linux and you want to restart it, you can make use of the service management command like systemctl. But first let's try to understand the difference between restart and reload commands,
Nginx Reload vs Restart
Restart:
This will completely restart the Nginx service and will temporary interruption all the existing connections.
Reload:
If you have made changes to the configurations of your Nginx server - nginx.conf, then you can make use of the reload command as this will not completely restart the running service and will have minimal impact on the running instance. You can call it a graceful or soft reload.
Important tip:
Before you can either restart or reload the command, it's always a good practice to run a configuration test to make sure that there are no syntax errors in the configuration files. You can call it a hard restart.
# sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!