0
0
Nginxdevops~10 mins

Health checks in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a basic HTTP health check location in nginx.

Nginx
location /healthz {
    return [1];
}
Drag options to blanks, or click blank then click option'
A404
B301
C200
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using 404 or 500 which indicate errors.
Using 301 which is a redirect, not a health check response.
2fill in blank
medium

Complete the code to enable active health checks for an upstream server in nginx.

Nginx
upstream backend {
    server backend1.example.com;
    [1];
}
Drag options to blanks, or click blank then click option'
Aenable_health
Bcheck_health
Cactive_check
Dhealth_check
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect directive names like check_health or active_check.
Forgetting to add the directive inside the upstream block.
3fill in blank
hard

Fix the error in the health check configuration by completing the directive correctly.

Nginx
server {
    location /health {
        proxy_pass http://backend;
        proxy_next_upstream [1];
    }
}
Drag options to blanks, or click blank then click option'
Aon
Boff
Cerror
Dfail
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'on' which enables retries and can hide failures.
Using invalid values like 'error' or 'fail'.
4fill in blank
hard

Fill both blanks to configure a passive health check that marks a server down after 3 failures.

Nginx
upstream backend {
    server backend1.example.com max_fails=[1] fail_timeout=[2];
}
Drag options to blanks, or click blank then click option'
A3
B5s
C10s
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using too low max_fails like 1 which may mark server down too quickly.
Using fail_timeout without 's' suffix or with wrong units.
5fill in blank
hard

Fill all three blanks to configure an HTTP health check with interval, timeout, and HTTP status match.

Nginx
health_check interval=[1] timeout=[2] rise=2 fall=5 http_statuses=[3];
Drag options to blanks, or click blank then click option'
A5s
B2s
C200-299
D10s
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up interval and timeout values.
Using invalid HTTP status ranges.