You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/how-to/monitoring/troubleshooting.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ docs: "DOCS-1419"
7
7
8
8
{{< custom-styles >}}
9
9
10
-
This topic describes possible issues users might encounter when using NGINX Gateway Fabric. When possible, suggested workarounds are provided.
10
+
This topic describes general troubleshooting techniques when users run into problems using NGINX Gateway Fabric. When possible, suggested workarounds are provided.
Logs from the NGINX Gateway Fabric control plane and data plane can contain information that isn't available to status or events. These can include errors in processing or passing traffic.
81
+
Logs from the NGINX Gateway Fabric control plane and data plane can contain information that isn't available to status or events. These can include errors in processing or passing traffic. You can see logs for a crashed or killed container by adding the `-p` flag to the above commands.
82
82
83
83
1. Container Logs
84
84
@@ -96,9 +96,7 @@ Logs from the NGINX Gateway Fabric control plane and data plane can contain info
96
96
97
97
1. Error Logs
98
98
99
-
To see error logs for control plane and data plane containers:
100
-
101
-
For _nginx-gateway_ container, you can `grep`forthe word `error` or change the log level to `error` by following stepsin Modify log levels (Section 3). Once you have modified log levels, you can `grep`for the word `debug` to check debug logs for further investigation.
99
+
For _nginx-gateway_ container, you can `grep`forthe word `error` or change the log level to `error` by following stepsin Modify log levels (Section 4).
@@ -130,12 +128,15 @@ Logs from the NGINX Gateway Fabric control plane and data plane can contain info
130
128
NGINX access logs record all requests processed by the NGINX server. These logs provide detailed information about each request, which can be useful for troubleshooting and analyzing web traffic.
131
129
Access logs can be viewed with the above method of using `kubectl logs`, or by viewing the access log file directly. To do that, get shell access to your NGINX container using these [steps](#get-shell-access-to-nginx-container). The access logs are located in the file `/var/log/nginx/access.log` in the NGINX container.
132
130
133
-
You can see logs for a crashed or killed container by adding the `-p` flag to the above commands.
134
-
135
131
1. Modify Log Levels
136
132
137
133
To see debug logs forcontrol planein NGINX Gateway Fabric, enable verbose logging by editing the `NginxGateway` configuration. This can be done either before or after deploying NGINX Gateway Fabric. Refer to this [guide](https://docs.nginx.com/nginx-gateway-fabric/how-to/configuration/control-plane-configuration) to do so.
138
134
135
+
1. Debug Logs
136
+
137
+
Once you have modified log levels for NGINX Gateway Fabric, you can `grep`for the word `debug` to check debug logs for further investigation.
138
+
139
+
139
140
#### Understanding the generated NGINX config
140
141
141
142
Understanding the NGINX configuration is key forfixing issues because it shows how NGINX handles requests. This helps tweak settings to make sure NGINX behaves the way you want it to for your application. To see your current configuration, you can open a shellin the _nginx_ container by following these [steps](#get-shell-access-to-nginx-container) and run `nginx -T`. To understand the usage of NGINX directives in the configuration file, consult this list of [NGINX directives](https://nginx.org/en/docs/dirindex.html).
@@ -156,7 +157,7 @@ server {
156
157
157
158
Once a HTTPRoute with path matches and rules are defined, the nginx.conf is updated accordingly to determine which location block will manage incoming requests. To demonstrate how `nginx.conf` is changed, let's create some resources:
158
159
159
-
1. A Gateway with single listener with the hostname `*.example.com` on port 80.
160
+
1. A Gateway with single listener with the hostname `*.example.com` on port 80.
160
161
2. A simple `coffee` application.
161
162
3. An HTTPRoute that exposes the `coffee` application outside the cluster using the listener created in step 1. The path and rule matches create different location blocks in`nginx.conf` to route requests as needed.
162
163
@@ -314,7 +315,7 @@ To debug why your reload has failed, start with verifying the syntax of your con
314
315
315
316
##### NGINX Gateway Fabric Pod is not running or ready
316
317
317
-
To understand why the NGINX Gateway Fabric Pod has not started running or is not ready, the first step is to check the state of the Pod to get detailed information about the current status and events happening in the Pod. To do this, use `kubectl describe`:
318
+
To understand why the NGINX Gateway Fabric Pod has not started running or is not ready, check the state of the Pod to get detailed information about the current status and events happening in the Pod. To do this, use `kubectl describe`:
318
319
319
320
```shell
320
321
kubectl describe pod <ngf-pod-name> -n nginx-gateway
0 commit comments