0
0
Nginxdevops~5 mins

Backup servers in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a backup server in the context of nginx?
A backup server is a secondary server that nginx uses only if the primary server is unavailable or fails. It helps keep the website or service running smoothly.
Click to reveal answer
beginner
How do you define a backup server in an nginx upstream block?
You add the keyword backup after the server address inside the upstream block. For example: <br>
upstream backend {
  server primary.example.com;
  server backup.example.com backup;
}
Click to reveal answer
intermediate
Why use a backup server instead of just multiple primary servers?
A backup server is only used when all primary servers fail. This saves resources and avoids unnecessary load on the backup. It acts like a safety net.
Click to reveal answer
intermediate
What happens if the primary server recovers after the backup server starts handling requests?
nginx automatically switches back to the primary server once it is healthy again, stopping requests to the backup server.
Click to reveal answer
beginner
Write a simple nginx upstream block with one primary and one backup server.
upstream backend {
  server primary.example.com;
  server backup.example.com backup;
}
Click to reveal answer
In nginx, what keyword marks a server as a backup in an upstream block?
Abackup
Bsecondary
Cfailover
Dreserve
When does nginx send traffic to a backup server?
AAll the time, in rotation
BOnly when all primary servers are down
COnly during peak hours
DWhen the backup server is manually enabled
What happens if the primary server comes back online after nginx switched to the backup?
Anginx continues using the backup server forever
Bnginx requires a manual restart
Cnginx switches back to the primary server automatically
Dnginx sends traffic to both servers equally
Which of these is NOT a benefit of using a backup server in nginx?
AReduces load on primary servers during normal operation
BActs as a safety net for failover
CImproves availability during primary server failure
DEnsures continuous service
How do you test if your nginx backup server configuration works?
AChange the backup server to primary
BRestart nginx without changing config
CAdd more primary servers
DStop the primary server and check if requests go to the backup
Explain how nginx uses backup servers in load balancing and why they are important.
Think about what happens when the main server is down.
You got /4 concepts.
    Describe how to configure a backup server in nginx and how nginx switches between primary and backup servers.
    Focus on the nginx configuration syntax and behavior.
    You got /4 concepts.