Where does nginx store vhosts config while running

crzpiot asked:

I have accidentally replaced my vhost file in sites-available in nginx. The file contained a lot of 301 redirects, which are still working while the reload command is not run. Does nginx store the files loaded from sites-available while running so that I can copy and restore it or do I have to write the entire file again?

Thanks a lot.

My answer:


Run nginx -T to get a dump of the current running configuration. This requires nginx 1.9.2 or later.

And for the love of gawd, set up backups.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.