0
0
Nginxdevops~20 mins

Health checks in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Health Check Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Nginx active health check status output
You have configured an active health check in Nginx for your backend servers. Which command output snippet correctly shows that the backend server is healthy?
Nginx
curl -s http://localhost/nginx_status | grep 'upstream server'
Aupstream server backend1 is UP
Bupstream server backend1 is DOWN
Cupstream server backend1 is UNKNOWN
Dupstream server backend1 is TIMEOUT
Attempts:
2 left
💡 Hint
Look for the status that indicates the server is responding correctly.
Configuration
intermediate
2:00remaining
Correct Nginx passive health check directive
Which Nginx configuration snippet correctly enables passive health checks for an upstream named app_servers?
A
upstream app_servers {
    server 192.168.1.10;
    server 192.168.1.11;
    health_check;
}
B
upstream app_servers {
    server 192.168.1.10 max_fails=3 fail_timeout=30s;
    server 192.168.1.11 max_fails=3 fail_timeout=30s;
}
C
upstream app_servers {
    server 192.168.1.10;
    server 192.168.1.11;
    passive_check;
}
D
upstream app_servers {
    server 192.168.1.10;
    server 192.168.1.11;
    passive_health_check on;
}
Attempts:
2 left
💡 Hint
Passive health checks use max_fails and fail_timeout parameters.
Troubleshoot
advanced
2:00remaining
Diagnosing failed active health checks in Nginx
You configured active health checks in Nginx but all backend servers show as DOWN. Which of the following is the most likely cause?
AThe health check URI path is incorrect or returns a non-200 status
BThe upstream servers are overloaded but still respond with 200 OK
CThe passive health check parameters max_fails and fail_timeout are missing
DThe Nginx worker_processes is set to 1
Attempts:
2 left
💡 Hint
Active health checks depend on a correct URI and response status.
🔀 Workflow
advanced
2:30remaining
Order of steps to enable active health checks in Nginx
Arrange the steps in the correct order to enable active health checks for an upstream in Nginx.
A2,1,4,3
B4,1,2,3
C1,2,4,3
D1,4,2,3
Attempts:
2 left
💡 Hint
You must define servers before adding health checks and reload last.
Best Practice
expert
2:00remaining
Best practice for health check intervals in production
What is the best practice for setting the interval of active health checks in a high-traffic production Nginx environment?
ASet a very long interval (5 minutes) to reduce load on backend servers
BDisable active health checks and rely only on passive checks
CSet a moderate interval (10-30 seconds) balancing detection speed and load
DSet a very short interval (1 second) to detect failures immediately
Attempts:
2 left
💡 Hint
Consider backend load and failure detection speed.