If you have an up and running Nginx server on your device and want to stop it, lets see some of the ways you can stop it,
- Using systemctl command:
# systemctl stop nginx
# sudo systemctl stop nginx
- Using service command:
# service stop nginx * Stopping nginx nginx [OK]
# sudo service stop nginx
- Using nginx stop command:
# nginx -s stopx
# sudo service nginx -s stop
Note if the service is already stopped, you would see the below message, else the command will return to the prompt.
# nginx -s stop nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

More Posts related to Linux,
- [Fix] Linux - bash: useradd: command not found
- Calculate days between dates using dateutils ddiff command
- pwd Command - Print Working Directory
- Rename a directory using Linux/Unix command
- How to go to the End of File in Nano Editor
- How to tar.gz a directory or folder Command
- How to remove/delete a directory in Linux/macOs
- How to Display content of a file in Terminal Screen?
- ls command sort by file size [Linix/UNIX/macOS/bash]
- How to Copy Entire Directory to another Directory in Linux
- 3 ways to clear screen on Linux Terminal
- Command to check Last Login or Reboot History of Users and TTYs
- How to check uptime of Linux/Unix/macOS system/server using console command?
- How to backup a file in Linux/Unix
- Command to know the installed Debian version?
- Check SSH/OpenSSH version Command
- 3 Commands to stop Nginx Server
- Linux: Create a New User and Password and Login Example
- How to install npm on Ubuntu
- How to List All Users in Linux
- How to Get the List of Shells on Linux
- Fix - ssh-copy-id no identities found error
- Installing and using unzip Command to unzip a zip file using Terminal
- scp: ssh: connect to host xxxx port 22: Connection refused Error
- zsh hello world example
More Posts:
- How to insert image into Google Sheets cell - Google
- macOS Big Sur compatible Macs List - MacOS
- How to install Packages in Sublime Text Editor - Sublime-Text
- say command macOS terminal examples - MacOS
- This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView) Lint Error - Android
- Microsoft Teams adds New Conversation Button - Teams
- Java: TimeZone List with GMT/UTC Offset - Java
- SQL: Check if table exists - HowTos