To completely uninstall NGINX from your system, follow the appropriate instructions based on your operating system:
For Ubuntu/Debian-based systems:
Stop the NGINX service:
sudo systemctl stop nginx
Disable the NGINX service (so it doesn’t start on boot):
sudo systemctl disable nginx
Remove NGINX and its dependencies: Run the following command to remove the NGINX package:
sudo apt-get purge nginx nginx-common nginx-full nginx-core
Remove any unused dependencies: After removing NGINX, you can clean up any unused packages: