Hello, i need to update my nginx to latest stable version. how can i do that without loosing my server blocks and nginx.conf file. i mean how can i backup all configuration before updating nginx and restore them back.
thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Updating nginx should not affect any config files that you have created or modified. You can update nginx to the latest version by running
sudo apt-get updateto update the package lists, followed by
sudo apt-get install nginx.
If you want to be extra careful, you can back up the
/etc/nginxdirectory which contains all of nginx’s config files.
After upgrading the package, you can delete
/etc/nginx. However, as I said, it is unnecessary and completely optional to do it.
I just observed that a recent Nginx upgrade did the following:
The first bullet can be addressed… from my personalized site config I can serve my static files up from a different direction.
But I don’t know how to address the 2nd bullet. Upgrading Nginx essentially takes down your website and replaces it with a welcome page.
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Sign up now