diff --git a/content/includes/use-cases/monitoring/enable-nginx-plus-api.md b/content/includes/use-cases/monitoring/enable-nginx-plus-api.md index b0fbe9973..d9dd46dc0 100644 --- a/content/includes/use-cases/monitoring/enable-nginx-plus-api.md +++ b/content/includes/use-cases/monitoring/enable-nginx-plus-api.md @@ -2,9 +2,9 @@ docs: files: - content/nim/monitoring/overview-metrics.md - - content/nginx-one/getting-started.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): ```nginx diff --git a/content/nginx-one/getting-started.md b/content/nginx-one/getting-started.md index 789580da1..9e3a0e8e5 100644 --- a/content/nginx-one/getting-started.md +++ b/content/nginx-one/getting-started.md @@ -136,17 +136,41 @@ If you followed the [Installation and upgrade](https://docs.nginx.com/nginx-agen ## Enable NGINX metrics reporting -In order for NGINX One Console to show specific traffic and system metrics, you need to enable the appropriate API on your NGINX data plane instances. The sections below provide step-by-step instructions for both NGINX Plus and NGINX Open Source (OSS). +The NGINX One Console dashboard relies on APIs for NGINX Plus and NGINX Open Source Stub Status to report traffic and system metrics. The following sections show you how to enable those metrics. ### Enable NGINX Plus API -{{< include "/use-cases/monitoring/enable-nginx-plus-api.md" >}} + +To collect metrics for NGINX Plus, add the following to your NGINX Plus configuration file: + +```nginx +# 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. + +After saving the changes, reload NGINX to apply the new configuration: + +```shell +nginx -s reload +``` ### Enable NGINX Open Source Stub Status API {{< include "/use-cases/monitoring/enable-nginx-oss-stub-status.md" >}} ---- +--- ## View instance metrics with the NGINX One dashboard