generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 120
Updated the config snippet for enabling the NGINX Plus API and dashboard #739
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c67d692
updated the nginx config snippet for enabling the NGINX Plus API and …
travisamartin 134158b
edits
travisamartin 07f8d78
Update content/includes/use-cases/monitoring/enable-nginx-plus-api.md
travisamartin 31957a5
edits per tech review
travisamartin a327b2c
Merge branch 'main' into enable-nplus-api-dashboard-edits
travisamartin 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
42 changes: 42 additions & 0 deletions
42
content/includes/config-snippets/enable-nplus-api-dashboard.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,42 @@ | ||
| --- | ||
| docs: | ||
| files: | ||
| - content/nginx-one/workshops/lab5/upgrade-nginx-plus-to-latest-version.md | ||
| - content/includes/use-cases/monitoring/enable-nginx-plus-api.md | ||
| --- | ||
|
|
||
| ```nginx | ||
| # This block enables the NGINX Plus API and dashboard | ||
| # 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; | ||
|
|
||
| location /api/ { | ||
| # To restrict write methods (POST, PATCH, DELETE), uncomment: | ||
| # 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 and set your network: | ||
| # allow 192.0.2.0/24 # replace with your network | ||
| # deny all; | ||
| } | ||
|
|
||
| # Serve the built-in dashboard at /dashboard.html | ||
| location = /dashboard.html { | ||
| root /usr/share/nginx/html; | ||
| } | ||
|
|
||
| # Redirect any request to the root path "/" to the dashboard | ||
| location / { | ||
| return 301 /dashboard.html; | ||
| } | ||
| } | ||
| ``` |
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.