Delete nginx associated configuration files
sudo apt-get purge nginx # removes everything.
Uninstall nginx dependent programs that are no longer needed
sudo apt-get autoremove
You can check the version at this time nginx -v
To No such file
you also need to delete some nginx files in the system, manually delete
rm -rf /etc/nginx
rm -rf /etc/init.d/nginx
rm -rf /var/lib/nginx
rm -rf /var/log/nginx
rm -rf /etc/logrotate.d/nginx
This way Nginx will be completely deleted
The above has introduced how to completely uninstall nginx on ubuntu, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.