Skip to content

Commit 2da5e96

Browse files
authored
Merge branch 'main' into unit-docs
2 parents 676937b + 8382b32 commit 2da5e96

File tree

139 files changed

+10581
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+10581
-183
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ Closes #ISSUE
2121

2222
Before merging a pull request, run through this checklist and mark each as complete.
2323

24-
- [ ] I have read the [contributing guidelines](/CONTRIBUTING.md)
24+
- [ ] I have read the [contributing guidelines](https://github.com/nginx/documentation/blob/main/CONTRIBUTING.md)
2525
- [ ] I have signed the [F5 Contributor License Agreement (CLA)](https://github.com/f5/.github/blob/main/CLA/cla-markdown.md)
26-
- [ ] I have ensured that documentation content adheres to [the style guide](/templates/style-guide.md)
26+
- [ ] I have ensured that documentation content adheres to [the style guide](https://github.com/nginx/documentation/blob/main/templates/style-guide.md)
2727
- [ ] If the change involves potentially sensitive changes, I have assessed the possible impact
2828
- [ ] If applicable, I have added tests that prove my fix is effective or that my feature works
2929
- [ ] If applicable, I have checked that any relevant tests pass after adding my changes
30-
- [ ] I have updated any relevant documentation ([`README.md`](/README.md) and [`CHANGELOG.md`](/CHANGELOG.md))
30+
- [ ] I have updated any relevant documentation ([`README.md`](https://github.com/nginx/documentation/blob/main/README.md) and [`CHANGELOG.md`](https://github.com/nginx/documentation/blob/main/CHANGELOG.md)
3131
- [ ] I have rebased my branch onto main
3232
- [ ] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork
3333

3434
Potentially sensitive changes include anything involving code, personally identify information (PII), live URLs or significant amounts of new or revised documentation.
3535

36-
Please refer to [our style guide](/templates/style-guide.md) for guidance about placeholder content.
36+
Please refer to [our style guide](https://github.com/nginx/documentation/blob/main/templates/style-guide.md) for guidance about placeholder content.

.github/workflows/build-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: nginxinc/docs-actions/.github/workflows/docs-build-push.yml@9c59fab05a8131f4d691ba6ea2b6a119f3ef832a # v1.0.7
6060
with:
6161
production_url_path: ""
62-
preview_url_path: "/previews/docs"
62+
preview_url_path: "${{ vars.PREVIEW_URL_PATH }}"
6363
docs_source_path: "public"
6464
docs_build_path: "./"
6565
doc_type: "hugo"

.github/workflows/linkchecker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
7373
with:
7474
creds: ${{secrets.AZURE_CREDENTIALS_DOCS}}
75-
75+
7676
- name: Retrieve secrets from Keyvault
7777
if: env.isProduction != 'true'
7878
id: keyvault

archetypes/concept.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ It is an example of a <other concept>, and is closely related to <third concept>
3535

3636
## Use cases
3737

38-
[//]: # "Name the individual use case sections after the actual use case itself, e.g "Route traffic between applications"
38+
[//]: # "Name the individual use case sections after the actual use case itself, e.g 'Route traffic between applications'"
3939

4040
### Use case 1
4141

config/_default/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ enableGitInfo = true
1616
ngf = '/nginx-gateway-fabric/:sections[1:]/:filename'
1717
nim = '/nginx-instance-manager/:sections[1:]/:filename'
1818
nms = '/nginx-management-suite/:sections[1:]/:filename'
19+
unit = '/nginx-unit/:sections[1:]/:filename'
1920
agent = '/nginx-agent/:sections[1:]/:filename'
21+
nginxaas = '/nginxaas/azure/:sections[1:]/:filename'
2022

2123
[caches]
2224
[caches.modules]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
docs: "DOCS-000"
3+
---
4+
5+
If the diagnostic setting destination details included a storage account, logs show up in the storage container "insights-logs-nginxlogs" with the following format: `resourceID=/<NGINXaaS-resourceID>/y=<YYYY>/m=<MM>/d=<DD>/h=<HH>/PT1H.json`
6+
7+
{{<bootstrap-table "table table-striped table-bordered">}}
8+
| **Attribute** | **Description** |
9+
|-----------------------------|-----------------|
10+
| `<NGINXaaS-resourceID>` | The resourceID of the NGINXaaS deployment in upper case.|
11+
| `<YYYY>` | The four-digit year when the log batch was generated.|
12+
| `<MM>` | The two-digit month when the log batch was generated.|
13+
| `<DD>` | The two-digit day when the log batch was generated.|
14+
| `<HH>` | The two-digit hour value that indicates the starting hour for the log batch, in 24 hour UTC format|
15+
{{</bootstrap-table>}}
16+
17+
{{<note>}}It can take up to 90 minutes after adding diagnostic settings for logs to appear in the provided Azure Storage container.{{</note>}}
18+
19+
Each log event in the "PT1H.json" file is written in a new line delimited JSON text format. The properties that show up in each log line are described in the [Top Level Common Schema](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/resource-logs-schema#top-level-common-schema) documentation.
20+
21+
For instance, an access log event logging to a particular file path will have attributes similar to this example:
22+
23+
```yaml
24+
{
25+
"category": "NginxLogs",
26+
"location": "westcentralus",
27+
"operationName": "NGINX.NGINXPLUS/NGINXDEPLOYMENTS/LOG",
28+
"properties": {
29+
"message": "172.92.129.50 - \"-\" [18/Jan/2024:17:59:00 +0000] \"GET / HTTP/1.1\" 200 11232 \"-\" \"curl/8.4.0\" \"-\" \"20.69.58.179\" sn=\"localhost\" rt=0.000 ua=\"-\" us=\"-\" ut=\"-\" ul=\"-\" cs=\"-\" ",
30+
"filePath": "/var/log/nginx/access.log"
31+
},
32+
"resourceId": "/SUBSCRIPTIONS/FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF/RESOURCEGROUPS/RESOURCEGROUP1/PROVIDERS/NGINX.NGINXPLUS/NGINXDEPLOYMENTS/TEST1",
33+
"time": "2024-01-18T17:59:00.363956795Z"
34+
}
35+
```
36+
37+
If [syslog-based](#logging-to-syslog) logs are used, the log event entry has different **properties** sub-fields:
38+
39+
```yaml
40+
#...
41+
"properties": {
42+
"message": "172.92.129.50 - - [16/Jan/2024:18:00:00 +0000] \"GET / HTTP/1.1\" 200 11232 \"-\" \"curl/8.4.0\"",
43+
"tag": "nginx",
44+
"severity": "info",
45+
"facility": "local7"
46+
},
47+
#...
48+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
docs: "DOCS-000"
3+
---
4+
5+
If the diagnostic setting destination details included a Logs Analytics workspace, logs show up in the table "NGXOperationLogs" with the following non-standard attributes:
6+
7+
{{<bootstrap-table "table table-striped table-bordered">}}
8+
| **Attribute** | **Description** |
9+
|-----------------------------|-----------------|
10+
| **Location** | The location of the NGINXaaS resource.|
11+
| **Message** | The generated NGINX log line. |
12+
| **FilePath** | The path to which NGINX logs were configured to be logged to if the nginx config used file-based logs. |
13+
| **Tag** | The tag with which NGINX logs were generated if syslog-based log configuration is used. By default this is nginx |
14+
| **Facility** | The syslog facility with which NGINX logs were generated if syslog-based log configuration is used. |
15+
| **Severity** | The syslog severity with which NGINX logs were generated if syslog-based log configuration is used. |
16+
17+
{{</bootstrap-table>}}
18+
19+
Using a [KQL](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/), a custom query can be run to view the logs:
20+
21+
```
22+
NGXOperationLogs
23+
| where Location contains "eastus"
24+
```
25+
26+
For more information on the standard attributes that appear in Logs Analytics,see the [Standard columns in Azure Monitor Logs](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-standard-columns) documentation.
27+
28+
For more information on using [KQL](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/) see [Queries in Log Analytics](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/queries?tabs=groupby).
29+
30+
{{<note>}}It can take up to 90 minutes after adding diagnostic settings for logs to appear in the provided Logs Analytics Workspace.{{</note>}}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
docs: "DOCS-000"
3+
---
4+
5+
NGINX access logs are disabled by default. You can enable access logs by adding **access_log** directives to your NGINX configuration to specify the location of the logs and formats. The log path should always be configured to be inside **/var/log/nginx**.
6+
7+
```nginx
8+
http {
9+
log_format myfmt '$remote_addr - $remote_user [$time_local] '
10+
'"$request" $status $body_bytes_sent '
11+
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
12+
13+
access_log /var/log/nginx/nginx-access.log myfmt;
14+
# ...
15+
}
16+
```
17+
18+
{{<note>}} The **$time_local** variable includes the date and time for each log. It helps with ordering logs after export. {{</note>}}
19+
20+
To explicitly disable access logs, apply the following config:
21+
22+
```nginx
23+
http {
24+
access_log off;
25+
}
26+
```
27+
28+
or
29+
30+
```nginx
31+
http {
32+
access_log /dev/null;
33+
}
34+
```
35+
36+
To learn more about how to specify `access__log` in different configuration levels and their effect, see [access_log](https://nginx.org/en/docs/http/ngx_http_log_module.html#access_log)
37+
38+
{{<warning>}}Unless you use **syslog**, keep NGINX logs in the **/var/log/nginx** directory. Otherwise, you may lose data from your logs.
39+
{{</warning>}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
docs: "DOCS-000"
3+
---
4+
5+
By default, NGINXaaS for Azure puts the error log at **/var/log/nginx/error.log**. It includes messages with severity **error** and above.
6+
7+
While you should configure log files in the **/var/log/nginx** directory, you can change the filename and severity level. For example, the following line in the NGINX configuration sends errors to the `nginx-error.log` file, and limits messages to a severity level of **emerg**:
8+
9+
```nginx
10+
error_log /var/log/nginx/nginx-error.log emerg;
11+
```
12+
13+
Alternatively, you can disable error logs completely with the following line:
14+
15+
```nginx
16+
error_log /dev/null;
17+
```
18+
19+
To learn more about how to specify `error_log` in different configuration levels, see the documentation of the [error_log](https://nginx.org/en/docs/ngx_core_module.html?#error_log) directive.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
docs: "DOCS-000"
3+
---
4+
5+
1. File-based logs must be configured to use the path **/var/log/nginx**.
6+
1. The **gzip** parameter for the **access_log** directive is not supported, and uploading a config with this parameter will cause an error.
7+
1. Logging **error_log** to a cyclic memory buffer using the **memory:** prefix is not allowed and will cause a config upload error.
8+
1. Egress Networking charges apply for traffic sent from the NGINX deployment to a syslog server present in a different VNet.

0 commit comments

Comments
 (0)