Nginx.conf overwriting?

We recently setup a Nginx Server and even if Nginx themselves say that users should place their configs in the subfolder conf.d, we decided to not do so.

First and mainly because one does not know how multiple instances would overwrite themself and in what order they would be loaded.

So we took the nginx.conf, cleaned it up and put our stuff in there. It works that's not a problem... I'm just questioning myself if (in the past) nginx anytime updated the nginx.conf with one of there updates?

That would be a bummer for us. I can't believe that this would happen but maybe you guys have had this situation that the default nginx.conf was updated in the past. Then this information would be quite interessing for me.

If not i'm also happy :)

1 Answer

It should be pretty safe to do what you did.

Usually, when an Ubuntu update needs to replace a configuration file, it detects if the file has been modified and asks you what it should do.

You can then choose to keep your version, and then the updater creates a new configuration file with extension .dkpg-dist which contains the (updated) configuration for the new package version (in your case nginx.conf.dpkg-dist).

You can then easily check which are the differences between the new config file and your custom one and decide if you want to incorporate them (usually a good idea to keep current with new defaults, security fixes, etc).

You can also choose to instead install the new version, or maybe some kind of option/default you use forces the "overwrite" without asking, but even then your customizations are not lost.

You'll find a nginx.conf.dpkg-old which contains a backup of your nginx.conf before the upgrader "overwrote" the configuration.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like