Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 1022 Bytes

enable-nginx-plus-api.md

File metadata and controls

33 lines (27 loc) · 1022 Bytes
docs files
content/nim/monitoring/overview-metrics.md
content/nginx-one/getting-started.md

To collect comprehensive metrics for NGINX Plus--including bytes streamed, information about upstream systems and caches, and counts of all HTTP status codes--add the following to your NGINX Plus configuration file (for example, /etc/nginx/nginx.conf or an included file):

# Enable the /api/ location with appropriate access control
# to use the NGINX Plus API.
#
location /api/ {
    api write=on;
    allow 127.0.0.1;
    deny all;
}

This configuration:

  • Enables the NGINX Plus API.
  • Allows requests only from 127.0.0.1 (localhost).
  • Blocks all other requests for security.

For more details, see the NGINX Plus API module documentation.

After saving the changes, reload NGINX to apply the new configuration:

nginx -s reload