There nginx config.
upstream { server 1.1.1.1:8080; server 2.2.2.2:8080 backup; } server { ... You must move the word backup from 2.2.2.2 to 1.1.1.1 and vice versa, using sed. For example, if:
server 1.1.1.1:8080 backup; server 2.2.2.2:8080; do:
server 1.1.1.1:8080; server 2.2.2.2:8080 backup; and if:
server 1.1.1.1:8080; server 2.2.2.2:8080 backup; do:
server 1.1.1.1:8080 backup; server 2.2.2.2:8080; How is this possible to do?
Addition: It is not known in advance where the backup will be located. Static information is only the IP address 1.1.1.1 and 2.2.2.2 .
1.1.1.1and remove where2.2.2.2” ... the overall complexity of the script will depend on the options for the diversity of configs ... - Fat-Zersed -e s/backup//g -e s/"1.1.1.1:8080"/"1.1.1.1:8080 backup"/gBut as I said earlier, it is not known where will be locatedbackup- Vitaliy Kalyuzhnyak