How to restart Nginx web server?

How do I restart nginx web server under Linux operating systems using command line options?

To restart the nginx web server use any one of the following commands as a root user in a terminal.

Debian/Ubuntu/RHEL/CentOS Linux

Use any of the following commands:

# /etc/init.d/nginx restart
# /etc/init.d/nginx reload
# service nginx restart
# service nginx reload

If Nginx is installed from source,  Nginx can reloaded as this as well,

# /path/to/full/nginx -s reload

Leave a comment

Your email address will not be published. Required fields are marked *