0
0
Nginxdevops~10 mins

Stub status module 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 enable the stub status location in nginx configuration.

Nginx
location /nginx_status {
    [1]
}
Drag options to blanks, or click blank then click option'
Astub_status off
Bstub_status;
Cstub_status on
Dstatus_stub on
Attempts:
3 left
💡 Hint
Common Mistakes
Adding 'on' or 'off' after stub_status
Using incorrect directive names like 'status_stub'
2fill in blank
medium

Complete the code to allow access only from localhost to the stub status page.

Nginx
location /nginx_status {
    stub_status;
    allow [1];
    deny all;
}
Drag options to blanks, or click blank then click option'
A127.0.0.1
B0.0.0.0
C192.168.1.1
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' instead of IP address
Allowing all IPs by mistake
3fill in blank
hard

Fix the error in this nginx configuration snippet to correctly enable stub status.

Nginx
location /status {
    stub_status [1]
}
Drag options to blanks, or click blank then click option'
Aon;
Btrue;
Cenable;
D;
Attempts:
3 left
💡 Hint
Common Mistakes
Adding 'on;' or 'enable;' after stub_status
Missing the semicolon
4fill in blank
hard

Fill both blanks to create a location block that enables stub status and restricts access to localhost.

Nginx
location /nginx_status {
    [1];
    [2] 127.0.0.1;
    deny all;
}
Drag options to blanks, or click blank then click option'
Astub_status
Ballow
Cdeny
Daccess
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deny' instead of 'allow' for localhost
Missing semicolons
5fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters stub status metrics with values greater than zero.

Nginx
metrics = { [2]: [1] for [3], [2] in status.items() if [2] > 0 }
Drag options to blanks, or click blank then click option'
A{
Bvalue
Ckey
D}
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of braces
Mixing up key and value names