Complete the code to enable the Nginx Plus status page.
location /status {
stub_status [1];
}The stub_status on; directive enables the Nginx status page.
Complete the code to allow access to the Nginx Plus status page only from localhost.
location /status {
allow [1];
deny all;
}The IP 127.0.0.1 represents localhost, allowing only local access.
Fix the error in the configuration to enable the Nginx Plus API endpoint.
location /api {
api [1];
}The correct directive to enable the API is api on;.
Fill both blanks to configure the Nginx Plus API to listen on port 8080 and allow only local access.
server {
listen [1];
location /api {
allow [2];
deny all;
api on;
}
}Port 8080 is commonly used for API endpoints, and 127.0.0.1 restricts access to localhost.
Fill all three blanks to create a status page with JSON format, enabled stub_status, and allow access from localhost.
location /status {
stub_status [1];
status_format [2];
allow [3];
deny all;
}Enable stub_status with on, set status_format json; for JSON output, and allow localhost access with 127.0.0.1.