B
B
BloodVIRUS2019-07-04 10:48:11
Nginx
BloodVIRUS, 2019-07-04 10:48:11

How to safely update nginx?

Hello. More than 4 years ago, a friend of mine set up a web server for me. I installed version 1.6.4 (I don’t know whether I collected it from sources, or installed it from the repository).
Now the task is to follow the steps from this article: https://habr.com/ru/post/158393/, which needs the ngx_http_substitutions_filter_module module. For one, I decided to kill two birds with one stone by updating nginx to the latest version. Communication with a friend has long been lost, I can’t ask him to do this.
I ask you to suggest how you can update on a combat server without painful consequences. I know for sure that the comrade did not set everything up according to the standard. For example, I have two directories, /etc/nginx/sites-primary in which there is one config per site, and /etc/nginx/sites-secondary with a single config if the config is not found in the previous folder. View config:

server {
    listen                          80;
    server_name                     ~^(www\.)?(?<domain>.+)$;

What do I need to back up just in case? /etc/nginx? If suddenly, something breaks when updating / compiling a new nginx, how can you return everything as it was?
In general, I have initial knowledge, but I’m afraid to climb into a working combat server with instructions from Google ..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2019-07-04
@sergiks

The command nginx -Vwill show which modules your nginx has been configured with.
config files all remain valid.
About a separate server for testing have already been advised.

T
TyzhSysAdmin, 2019-07-04
@POS_troi

Your configs should be backed up anyway, always - no one canceled a dead screw :)
Well, in the ansible/chef/etc
topic Compile on a test server (yes, even in a virtual machine on a laptop), compile the package, test it, transfer it to production.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question