How to install nginx and install the configuration files too
Solution 1:
Run apt-get remove --purge nginx nginx-full nginx-common
first, and then apt-get install nginx
and see if it works.
Solution 2:
first
sudo apt-get -o DPkg::options::=--force-confmiss --reinstall install nginx-common
then test
sudo nginx -t
Solution 3:
sudo apt-get --purge autoremove nginx
If you are not prompted to prove successful uninstall
which nginx