Skip to content

Commit 521ef3d

Browse files
authored
Add documentation on running NGINX in debug mode (#215)
Problem: Added support for running NGINX in debug mode in NGF's CP-DP split which changes the old way to run NGINX in debug mode. Solution: Update docs to show new way to run NGINX in debug mode.
1 parent 87b5de0 commit 521ef3d

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

content/ngf/how-to/data-plane-configuration.md

+21-10
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,30 @@ To run NGINX Gateway Fabric with NGINX in debug mode, follow the [installation d
317317

318318
Using Helm: Set `nginx.debug` to true.
319319

320-
Using Kubernetes Manifests: Under the `nginx` container of the deployment manifest, add `-c` and `rm -rf /var/run/nginx/*.sock && nginx-debug -g 'daemon off;'`
321-
as arguments and add `/bin/sh` as the command. The deployment manifest should look something like this:
320+
Using Kubernetes Manifests: In the deployment manifest, set the `spec.kubernetes.deployment.container.debug` field in the `NginxProxy` resource to true.
322321

323-
```text
324-
...
325-
- args:
326-
- -c
327-
- rm -rf /var/run/nginx/*.sock && nginx-debug -g 'daemon off;'
328-
command:
329-
- /bin/sh
330-
...
322+
If you want to change the NGINX mode after deploying NGINX Gateway Fabric, you can do so through the `NginxProxy` `spec.kubernetes.deployment.container.debug` field.
323+
324+
The following command creates a basic `NginxProxy` configuration that both sets the NGINX log level to `debug` and runs NGINX in `debug` mode.
325+
326+
```yaml
327+
kubectl apply -f - <<EOF
328+
apiVersion: gateway.nginx.org/v1alpha2
329+
kind: NginxProxy
330+
metadata:
331+
name: ngf-proxy-config
332+
spec:
333+
logging:
334+
errorLevel: debug
335+
kubernetes:
336+
deployment:
337+
container:
338+
debug: true
339+
EOF
331340
```
332341

342+
{{< note >}} When modifying any `deployment` field in the `NginxProxy` resource, any corresponding NGINX instances will be restarted. {{< /note >}}
343+
333344
---
334345

335346
## Configure PROXY protocol and RewriteClientIP settings

0 commit comments

Comments
 (0)