generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 125
Update N1C getting started guide with instructions on how to enable metrics collection for a NGINX Plus API with SSL enabled #1496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhurley
wants to merge
9
commits into
main
Choose a base branch
from
add-plus-api-with-ssl-agent-instructions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b97da9f
Update N1C getting started guide with instructions on how to enable m…
dhurley 5aa695e
chore: add important callout + add tabs
JTorreG 0306016
docs: refactor nginx oss metrics setup content
spencerugbo e721380
Update instructions for Plus API with SSL enabled
dhurley d913cfb
Restructure N1C metrics page
dhurley cc1018b
Restructure N1C metrics page
dhurley 4719224
Address feedback
dhurley 945d8bf
Merge branch 'main' into add-plus-api-with-ssl-agent-instructions
dhurley 2a01196
Address feedback
dhurley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
content/includes/use-cases/monitoring/enable-nginx-plus-api-with-ssl.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| --- | ||
| nd-product: MSC | ||
| nd-files: | ||
| - content/nginx-one-console/getting-started.md | ||
| --- | ||
|
|
||
| If SSL is enabled on the NGINX Plus API with self-signed certificates like this example: | ||
|
|
||
| ```nginx | ||
| # This block enables the NGINX Plus API and dashboard with SSL | ||
| # For configuration and security recommendations, see: | ||
| # https://docs.nginx.com/nginx/admin-guide/monitoring/live-activity-monitoring/#configuring-the-api | ||
| server { | ||
| # Change the listen port if 9000 conflicts | ||
| # (8080 is the conventional API port) | ||
| listen 9000 ssl; | ||
| ssl_certificate /etc/nginx/certs/nginx-selfsigned.crt; | ||
| ssl_certificate_key /etc/nginx/certs/nginx-selfsigned.key; | ||
|
|
||
| location /api/ { | ||
| # To restrict write methods (POST, PATCH, DELETE), uncomment: | ||
dhurley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # limit_except GET { | ||
| # auth_basic "NGINX Plus API"; | ||
| # auth_basic_user_file /path/to/passwd/file; | ||
| # } | ||
|
|
||
| # Enable API in write mode | ||
| api write=on; | ||
|
|
||
| # To restrict access by network, uncomment the following lines and set your network: | ||
| # allow 192.0.2.0/24; # replace with your network | ||
| # allow 127.0.0.1/32; # allow local NGINX Agent to call the NGINX Plus API to retrieve metrics | ||
| # deny all; | ||
| } | ||
|
|
||
| # Serve the built-in dashboard at /dashboard.html | ||
| location = /dashboard.html { | ||
| root /usr/share/nginx/html; | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| NGINX Agent configuration needs to be update with the following to enable the NGINX Agent to be able to call the NGINX Plus API. | ||
| ``` | ||
| data_plane_config: | ||
| nginx: | ||
| api_tls: | ||
| ca: "/etc/nginx/certs/nginx-selfsigned.crt" | ||
| ``` | ||
dhurley marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Here is an example of how to generate self-signed certificates | ||
dhurley marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
| 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" | ||
dhurley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.