Complete the code to enable basic status monitoring in Nginx.
server {
listen 80;
location /nginx_status {
stub_status [1];
allow 127.0.0.1;
deny all;
}
}The stub_status on; directive enables Nginx's built-in status monitoring page.
Complete the code to allow access to the Nginx status page only from localhost.
location /nginx_status {
stub_status on;
allow [1];
deny all;
}The IP 127.0.0.1 represents localhost, allowing only local access.
Fix the error in the Nginx configuration to correctly enable status monitoring.
location /status {
stub_status [1];
allow 127.0.0.1;
deny all;
}The correct directive value is on to enable stub status.
Fill both blanks to configure Nginx to listen on port 8080 and enable status monitoring.
server {
listen [1];
location /status {
stub_status [2];
allow 127.0.0.1;
deny all;
}
}Port 8080 is specified by listen 8080; and status monitoring is enabled by stub_status on;.
Fill all three blanks to create a location block that enables stub status, allows localhost, and denies others.
location [1] { stub_status [2]; allow [3]; deny all; }
The location path is /nginx_status, stub_status is enabled with on, and access is allowed only from 127.0.0.1.