0
0
Nginxdevops~10 mins

Why monitoring ensures reliability in Nginx - Test Your Understanding

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

Complete the code to enable basic status monitoring in Nginx.

Nginx
server {
    listen 80;
    location /nginx_status {
        stub_status [1];
        allow 127.0.0.1;
        deny all;
    }
}
Drag options to blanks, or click blank then click option'
Aoff
Benable
Con
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'off' disables the status page.
Using 'enable' or 'true' are not valid directives here.
2fill in blank
medium

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

Nginx
location /nginx_status {
    stub_status on;
    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 causes errors.
Allowing '0.0.0.0' would allow all IPs, which is insecure.
3fill in blank
hard

Fix the error in the Nginx configuration to correctly enable status monitoring.

Nginx
location /status {
    stub_status [1];
    allow 127.0.0.1;
    deny all;
}
Drag options to blanks, or click blank then click option'
Aactive
Benable
Ctrue
Don
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' causes syntax errors.
Using 'true' is not recognized by Nginx.
4fill in blank
hard

Fill both blanks to configure Nginx to listen on port 8080 and enable status monitoring.

Nginx
server {
    listen [1];
    location /status {
        stub_status [2];
        allow 127.0.0.1;
        deny all;
    }
}
Drag options to blanks, or click blank then click option'
A8080
B80
Con
Doff
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 80 instead of 8080.
Setting stub_status to 'off' disables monitoring.
5fill in blank
hard

Fill all three blanks to create a location block that enables stub status, allows localhost, and denies others.

Nginx
location [1] {
    stub_status [2];
    allow [3];
    deny all;
}
Drag options to blanks, or click blank then click option'
A/nginx_status
Bon
C127.0.0.1
D/status
Attempts:
3 left
💡 Hint
Common Mistakes
Using '/status' instead of '/nginx_status' for location.
Setting stub_status to 'off' disables monitoring.
Allowing IP other than 127.0.0.1.