Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(proxy): set the request body limit in the nginx examples

Yudhi Armyndharis7d507cedf565
diff --git a/charts/openwa/values.yaml b/charts/openwa/values.yaml
index d55d0e462..973ed870e 100644
--- a/charts/openwa/values.yaml
+++ b/charts/openwa/values.yaml
@@ -138,6 +138,10 @@ containerSecurityContext:
ingress:
enabled: false
className: ""
+ # ingress-nginx refuses a request body over 1m by default, below the 25mb the app accepts
+ # (BODY_SIZE_LIMIT), so a base64 media send fails with 413 before it reaches the pod. Raise it
+ # to at least BODY_SIZE_LIMIT, for example:
+ # nginx.ingress.kubernetes.io/proxy-body-size: 25m
annotations: {}
host: openwa.example.com
paths:
diff --git a/docs/12-troubleshooting-faq.md b/docs/12-troubleshooting-faq.md
index 2518897f5..7ca127dbc 100644
--- a/docs/12-troubleshooting-faq.md
+++ b/docs/12-troubleshooting-faq.md
@@ -862,6 +862,10 @@ MEDIA_DOWNLOAD_MAX_BYTES=52428800
# Default 25mb.
BODY_SIZE_LIMIT=25mb
+# Behind nginx, raise client_max_body_size to match: its default is 1m, so a base64 media send
+# is refused with nginx's own HTML 413 before OpenWA sees it. Behind ingress-nginx, set the
+# nginx.ingress.kubernetes.io/proxy-body-size annotation (default 1m).
+
# Note: send the body uncompressed. A request carrying Content-Encoding: gzip (or deflate/br)
# is refused with 415 — the aggregate in-flight cap counts bytes on the wire, so a compressed
# body would be admitted small and then inflated past the memory that cap exists to bound.
@@ -1327,6 +1331,11 @@ server {
listen 443 ssl;
server_name api.example.com;
+ # nginx refuses a request body over 1m by default, below the 25mb OpenWA itself accepts
+ # (BODY_SIZE_LIMIT), so base64 media sends would answer 413 before reaching OpenWA.
+ # Keep this at or above BODY_SIZE_LIMIT.
+ client_max_body_size 25m;
+
location / {
proxy_pass http://localhost:2785;
proxy_http_version 1.1;
diff --git a/docs/13-horizontal-scaling.md b/docs/13-horizontal-scaling.md
index 396dd7365..031cd759f 100644
--- a/docs/13-horizontal-scaling.md
+++ b/docs/13-horizontal-scaling.md
@@ -145,9 +145,10 @@
> connected to node A receives an event raised on node B. Scope honestly: this distributes event
> **fan-out only**. The per-key WS rate-limit buckets (counted per replica) and the engine registry
> are still process-local. Without `REDIS_ENABLED` the adapter is inert and delivery is single-node,
-> exactly as before. With it, every chat event also costs the emitting node one or two `lid_mappings`
-> lookups, even when no chat-restricted key exists: it cannot know whether another replica holds a
-> restricted socket, so it names the chat in every form for the rooms to match.
+> exactly as before. With it, every event of a one-to-one chat also costs the emitting node one or two
+> `lid_mappings` lookups (one for a `@lid` chat, none for a group), even when no chat-restricted key
+> exists: it cannot know whether another replica holds a restricted socket, so it names the chat in
+> every form for the rooms to match.
>
> **Mid-connection key eviction converges on a timer, not a broadcast, and only on one node.** The
> node that processes a revoke, delete, or narrowing tears down that key's sockets synchronously, in
@@ -661,6 +662,10 @@ server {
listen 80;
server_name openwa.example.com;
+ # nginx refuses a request body over 1m by default, below the 25mb OpenWA itself accepts
+ # (BODY_SIZE_LIMIT), so base64 media sends would answer 413 before reaching a node.
+ client_max_body_size 25m;
+
location / {
proxy_pass http://openwa;
proxy_http_version 1.1;