Complete the code to define a backup server in the upstream block.
upstream backend {
server backend1.example.com;
server [1] backup;
}The backup server is defined by adding the backup keyword after the server address. Here, backend2.example.com is set as the backup server.
Complete the code to set the proxy_pass directive to use the upstream group.
location / {
proxy_pass http://[1];
}The proxy_pass directive should point to the upstream group name, which is backend in this case.
Fix the error in the upstream block to correctly mark the backup server.
upstream backend {
server backend1.example.com;
server backend2.example.com [1];
}The correct keyword to mark a backup server in nginx is backup. Other options are invalid and cause errors.
Fill both blanks to define two servers, one main and one backup, in the upstream block.
upstream backend {
server [1];
server [2] backup;
}The first server is the main server, and the second is the backup server marked with the backup keyword.
Fill all three blanks to create a dictionary of servers with their status, marking the backup server correctly.
servers = {
'[1]': 'active',
'[2]': 'backup',
'[3]': 'active'
}The dictionary lists servers with their status. The second server is marked as backup.