Ever needed to know what’s going on right now with your NGINX Plus server? Do you suspect a DDoS attack, or are users reporting errors from your website? NGINX Plus includes a real‑time activity monitoring interface that provides key load and performance metrics. Using a simple RESTful JSON interface, it’s very easy to connect these stats to live dashboards and third‑party monitoring tools.
The live activity monitoring data is generated by the NGINX Plus API. You can configure live activity monitoring as follows:
server {
listen 8080;
location /api {
api write=on;
# directives limiting access to the API
}
location = /dashboard.html {
root /usr/share/nginx/html;
}
# Redirect requests made to the pre-NGINX Plus API dashboard
location = /status.html {
return 301 /dashboard.html;
}
}
The write=on
parameter is required if you want to use the API to reconfigure upstream groups or clear the set of collected statistics. It is not required to retrieve status information.
We recommend that you restrict access to the /api location. The NGINX Plus Admin Guide describes appropriate security schemes in more detail.
When you access the API, NGINX Plus returns a JSON‑formatted document containing the current statistics. You can request complete statistics at /api/api-version/, where api-version is the version number of the NGINX Plus API. You can also drill down to obtain subsets of the data or single data points, at specific API endpoints, including these:
For a list of all endpoints, see the reference documentation or the Swagger UI at demo.nginx.com.
You can also export NGINX Plus metrics to your choice of external monitoring tools. NGINX Plus integrates with popular third‑party and NGINX tools like these: