Skip to content

Commit 5c1bb13

Browse files
author
Kate Osborn
committed
Add how-to for ClientSettingsPolicy
1 parent cb72c25 commit 5c1bb13

File tree

11 files changed

+336
-67
lines changed

11 files changed

+336
-67
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Client Settings Policy
22

3-
This directory contains YAML files of ClientSettingsPolicies.
3+
This directory contains the YAML files used in the [ClientSettingsPolicy](https://docs.nginx.com/nginx-gateway-fabric/how-to/traffic-management/client-settings/) guide.

examples/client-settings-policy/csp-grpcroute.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/client-settings-policy/csp-httproutes.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
apiVersion: gateway.nginx.org/v1alpha1
22
kind: ClientSettingsPolicy
33
metadata:
4-
name: gw
5-
namespace: default
4+
name: gateway-client-settings
65
spec:
76
targetRef:
87
group: gateway.networking.k8s.io
98
kind: Gateway
109
name: gateway
1110
body:
12-
maxSize: 10m
13-
timeout: 30s
14-
keepAlive:
15-
requests: 100
16-
time: 5s
17-
timeout:
18-
server: 2s
19-
header: 1s
11+
maxSize: "50" # sizes without a unit are bytes.

examples/client-settings-policy/gateway.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ spec:
99
port: 80
1010
protocol: HTTP
1111
hostname: "*.example.com"
12-
- name: http2
13-
port: 8080
14-
protocol: HTTP
15-
hostname: "*.example.org"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: gateway.nginx.org/v1alpha1
2+
kind: ClientSettingsPolicy
3+
metadata:
4+
name: grpc-client-settings
5+
spec:
6+
targetRef:
7+
group: gateway.networking.k8s.io
8+
kind: GRPCRoute
9+
name: my-grpc-route
10+
body:
11+
maxSize: "75" # sizes without a unit are bytes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: gateway.nginx.org/v1alpha1
2+
kind: ClientSettingsPolicy
3+
metadata:
4+
name: tea-client-settings
5+
spec:
6+
targetRef:
7+
group: gateway.networking.k8s.io
8+
kind: HTTPRoute
9+
name: tea
10+
body:
11+
maxSize: "75" # sizes without a unit are bytes.

site/content/how-to/monitoring/troubleshooting.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,31 @@ If using NGINX Gateway Fabric with NGINX Plus as the data plane, you will see th
3535
#### Resolution
3636

3737
To resolve this issue, enable Usage Reporting by following the [Usage Reporting]({{< relref "installation/usage-reporting.md" >}}) guide.
38+
39+
### 413 Request Entity Too Large
40+
41+
#### Description
42+
43+
If you receive the following error:
44+
45+
```text
46+
<html>
47+
<head><title>413 Request Entity Too Large</title></head>
48+
<body>
49+
<center><h1>413 Request Entity Too Large</h1></center>
50+
<hr><center>nginx/1.25.5</center>
51+
</body>
52+
</html>
53+
```
54+
55+
or see the following error message in the NGINX logs:
56+
57+
```text
58+
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"
59+
```
60+
61+
the request body exceeds the [client_max_body_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size).
62+
63+
#### Resolution
64+
65+
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.

0 commit comments

Comments
 (0)