Complete the code to enable the Prometheus exporter in the Nginx configuration.
location /metrics {
[1];
}The stub_status on; directive enables the Nginx status page, which Prometheus can scrape.
Complete the code to allow Prometheus to access the metrics endpoint.
location /metrics {
stub_status on;
allow [1];
deny all;
}Allowing 127.0.0.1 means only the local machine can access the metrics, which is common for security.
Fix the error in the Prometheus exporter configuration snippet.
location /metrics {
stub_status [1];
allow 127.0.0.1;
deny all;
}The correct directive syntax is stub_status on; to enable the status module.
Fill both blanks to configure Nginx to expose Prometheus metrics with proper access control.
location /metrics {
stub_status [1];
allow [2];
deny all;
}Setting stub_status on; enables metrics. Allowing 192.168.1.0/24 permits access from the local network.
Fill all three blanks to create a Prometheus exporter config that enables metrics, allows local access, and denies others.
location /metrics {
stub_status [1];
allow [2];
deny [3];
}Enable metrics with on, allow local access with 127.0.0.1, and deny everyone else with all.