I have two backend server. I need to configure the nginx config so that when one server falls off, it switches to the second backend server
Unfortunately I found only about load distribution between several backend servers
I didn't work with nginx before only standart config setting
Okey, it was so easy In config need add directive
Backup - is options for 2nd server is the one that will rise when 1st server goes down.
After that in directive location / {} You need add
proxy_next_upstream - this shows for which returned errors it is necessary to transfer to another server. And when it catch this errors, he can change backend1 to backend2(backup server)