Skip to content

Commit

Permalink
Add how-to for ClientSettingsPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-osborn committed Jun 4, 2024
1 parent fc2ed96 commit 372b7fd
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 67 deletions.
2 changes: 1 addition & 1 deletion examples/client-settings-policy/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Client Settings Policy

This directory contains YAML files of ClientSettingsPolicies.
This directory contains the YAML files used in the [ClientSettingsPolicy](https://docs.nginx.com/nginx-gateway-fabric/how-to/traffic-management/client-settings/) guide.
File renamed without changes.
14 changes: 0 additions & 14 deletions examples/client-settings-policy/csp-grpcroute.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions examples/client-settings-policy/csp-httproutes.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
apiVersion: gateway.nginx.org/v1alpha1
kind: ClientSettingsPolicy
metadata:
name: gw
namespace: default
name: gateway-client-settings
spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gateway
body:
maxSize: 10m
timeout: 30s
keepAlive:
requests: 100
time: 5s
timeout:
server: 2s
header: 1s
maxSize: "50" # sizes without a unit are bytes.
4 changes: 0 additions & 4 deletions examples/client-settings-policy/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ spec:
port: 80
protocol: HTTP
hostname: "*.example.com"
- name: http2
port: 8080
protocol: HTTP
hostname: "*.example.org"
11 changes: 11 additions & 0 deletions examples/client-settings-policy/grpc-client-settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: gateway.nginx.org/v1alpha1
kind: ClientSettingsPolicy
metadata:
name: grpc-client-settings
spec:
targetRef:
group: gateway.networking.k8s.io
kind: GRPCRoute
name: my-grpc-route
body:
maxSize: "75" # sizes without a unit are bytes.
11 changes: 11 additions & 0 deletions examples/client-settings-policy/tea-client-settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: gateway.nginx.org/v1alpha1
kind: ClientSettingsPolicy
metadata:
name: tea-client-settings
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: tea
body:
maxSize: "75" # sizes without a unit are bytes.
28 changes: 28 additions & 0 deletions site/content/how-to/monitoring/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,31 @@ If using NGINX Gateway Fabric with NGINX Plus as the data plane, you will see th
#### Resolution

To resolve this issue, enable Usage Reporting by following the [Usage Reporting]({{< relref "installation/usage-reporting.md" >}}) guide.

### 413 Request Entity Too Large

#### Description

If you receive the following error:

```text
<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.25.5</center>
</body>
</html>
```

or see the following error message in the NGINX logs:

```text
2024/05/30 21:48:22 [error] 138#138: *43 client intended to send too large body: 112 bytes, client: 127.0.0.1, server: cafe.example.com, request: "POST /coffee HTTP/1.1", host: "cafe.example.com:8080"
```

the request body exceeds the [client_max_body_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size).

#### Resolution

You can configure the `client_max_body_size` using the `ClientSettingsPolicy` API. See this [guide]({{< relref "how-to/traffic-management/client-settings.md" >}}) for instructions.
Loading

0 comments on commit 372b7fd

Please sign in to comment.