How to restart ngnix server on CentOS

15,602

recommend way is as follows. This should work with any Linux distributions or Unix like operating systems:

$ nginx -s reload

OR

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

If nginx compiled and installed from source code

$ /usr/local/nginx/sbin/nginx -s reload
Share:
15,602

Related videos on Youtube

Deb
Author by

Deb

Updated on September 18, 2022

Comments

  • Deb
    Deb over 1 year

    I recent buy a VPS on DigitalOcean and installed CentOS and follow the tutorial to install Ngnix Server, then I follow the tutorial to create a Virtual Host, but when I put this command to restart:

    sudo /etc/init.d/nginx restart
    

    Console output an error:

    sudo: /etc/init.d/nginx: command not found
    

    I already search on Google and here for how to solve, but I didn't found solutions.