Skip to content

Commit b97da9f

Browse files
committed
Update N1C getting started guide with instructions on how to enable metrics collection for a NGINX Plus API with SSL enabled
1 parent 9029d8f commit b97da9f

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
nd-product: MSC
3+
nd-files:
4+
- content/nginx-one-console/getting-started.md
5+
---
6+
7+
If SSL is enabled on the NGINX Plus API with self-signed certificates like this example:
8+
9+
```nginx
10+
# This block enables the NGINX Plus API and dashboard with SSL
11+
# For configuration and security recommendations, see:
12+
# https://docs.nginx.com/nginx/admin-guide/monitoring/live-activity-monitoring/#configuring-the-api
13+
server {
14+
# Change the listen port if 9000 conflicts
15+
# (8080 is the conventional API port)
16+
listen 9000 ssl;
17+
ssl_certificate /etc/nginx/certs/nginx-selfsigned.crt;
18+
ssl_certificate_key /etc/nginx/certs/nginx-selfsigned.key;
19+
20+
location /api/ {
21+
# To restrict write methods (POST, PATCH, DELETE), uncomment:
22+
# limit_except GET {
23+
# auth_basic "NGINX Plus API";
24+
# auth_basic_user_file /path/to/passwd/file;
25+
# }
26+
27+
# Enable API in write mode
28+
api write=on;
29+
30+
# To restrict access by network, uncomment the following lines and set your network:
31+
# allow 192.0.2.0/24; # replace with your network
32+
# allow 127.0.0.1/32; # allow local NGINX Agent to call the NGINX Plus API to retrieve metrics
33+
# deny all;
34+
}
35+
36+
# Serve the built-in dashboard at /dashboard.html
37+
location = /dashboard.html {
38+
root /usr/share/nginx/html;
39+
}
40+
}
41+
```
42+
43+
NGINX Agent configuration needs to be update with the following to enable the NGINX Agent to be able to call the NGINX Plus API.
44+
```
45+
data_plane_config:
46+
nginx:
47+
api_tls:
48+
ca: "/etc/nginx/certs/nginx-selfsigned.crt"
49+
```
50+
51+
Here is an example of how to generate self-signed certificates
52+
```
53+
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/certs/nginx-selfsigned.key -out /etc/nginx/certs/nginx-selfsigned.crt -subj "/CN=localhost" -addext "subjectAltName=IP:127.0.0.1"
54+
```

content/nginx-one-console/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ The NGINX One Console dashboard relies on APIs for NGINX Plus and NGINX Open Sou
163163
164164
{{< include "/use-cases/monitoring/enable-nginx-plus-api.md" >}}
165165
166+
### Enable NGINX Plus API with SSL
167+
168+
{{< include "/use-cases/monitoring/enable-nginx-plus-api-with-ssl.md" >}}
169+
166170
### Enable NGINX Open Source Stub Status API
167171
168172
{{< include "/use-cases/monitoring/enable-nginx-oss-stub-status.md" >}}

0 commit comments

Comments
 (0)