nginx default.conf missing after creating a droplet snapshot

August 29, 2014 1.3k views


so I configured my droplet with nginx, php-fpm, mariadb, wordpress etc. and I thought it was a good idea to create a snapshot. When I booted back to my droplet, I couldn't access my site and after some investigating I found that /etc/nginx/conf.d/default.conf is missing, but there was a default.conf.rpmsave which looks like my last version of default.conf.

Before creating a snapshot I did a

# systemctl poweroff

My question is why did this happen and how can I prevent it.


edit: I just did another snapshot just to check it and this time default.conf didn't disappear. So I don't know what caused it the first time...I also remember that I had the same problem some time ago, but I was doing all kind of testing at that time and figured I accidentally did it myself.

Question remains though - what can cause default.conf to disappear and become default.conf.rpmsave and how do I prevent it?

1 Answer

It sounds like you must have had an update to nginx at some point before you made the snapshot. yum, the package manager for CentOS and Fedora will move config files to and rpmsave files when upgrading so that edits to config files won't get overwritten during the upgrade. rpmconf is an neat little utility that you can run after upgrades to check for any new rpmsave files. If it finds one, it will offer you the choice to merge it with the new file from the package or to just restore it.

(Shameless Debian/Ubuntu plug: That functionality is baked into apt.)

Have another answer? Share your knowledge.