js_import /usr/share/nginx-plus-module-prometheus/prometheus.js; # ... server { listen 10.40.32.42:8080; # ... location /api { api write=on; allow 10.0.0.0/8; deny all; } location = /dashboard.html { auth_basic "Password Required"; auth_basic_user_file /etc/nginx/.htpasswd; root /usr/share/nginx/html; allow 10.0.0.0/8; deny all; } location = /metrics { js_content prometheus.metrics; } }