I'm on Ubuntu and I was trying to recover the original settings of /etc/nginx/sites-enabled/default when I accidentally deleted the entire folder. Uninstalling and reinstalling nginx through apt-get won't recreate the original folders.
What can I do to recover them?

link|improve this question
Can't you simply download the package, extract it and find the configuration file you need? :) – tftd Jan 9 at 19:53
feedback

3 Answers

up vote 3 down vote accepted

Force the reinstall of the default config files with the --force-confmiss option of dpkg.

Looks like the packaging layout for nginx changed in 11.04. If you're on 10.10 or older:

sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx_*.deb

Or 11.04 and newer:

sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb
link|improve this answer
feedback

check for the deb package in your ubuntu system [your version of deb file may be different]

/var/cache/apt/archives/nginx-common_0.8.54-4_all.deb

open it using archive manager. Inside the archive check for folder /etc/nginx

This is the default nginx installation cfg folder. You can copy from here to /etc .

link|improve this answer
feedback

Don't just apt-get remove it, this will leave configurations behind. apt-get purge it, and any unused dependency. You can check inatallation status by grepping dpkg -l output

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.