Skip to content

Clarify buffering middleware defaults#13401

Merged
traefiker merged 3 commits into
traefik:v3.6from
amazon7737:docs/11323-buffering-defaults
Jul 6, 2026
Merged

Clarify buffering middleware defaults#13401
traefiker merged 3 commits into
traefik:v3.6from
amazon7737:docs/11323-buffering-defaults

Conversation

@amazon7737

@amazon7737 amazon7737 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Clarifies that buffering middleware options only apply when the middleware is explicitly attached to a router.

It also explains that maxRequestBodyBytes=0 keeps the request body size unlimited, but enabling the middleware still buffers the request before forwarding it upstream.

Motivation

Related to #11323.

In that issue, setting maxRequestBodyBytes=0 appeared to change large POST behavior. The important distinction is that configuring the option also enables the buffering middleware for the router, which can change how the request is forwarded upstream.

More

  • Added/updated tests
  • Added/updated documentation

@rtribotte

Copy link
Copy Markdown
Member

Hey @amazon7737,
Thanks for this contribution!
We've set this to "review" and will take a look at the code.
We'll update you once the review is done.

@rtribotte rtribotte changed the title docs: Clarify buffering middleware defaults Clarify buffering middleware defaults Jun 25, 2026
@kevinpollet kevinpollet self-assigned this Jul 3, 2026

@kevinpollet kevinpollet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @amazon7737,

I reviewed your pull request and added some comments.
As this pull request is a fix, could you rebase it on branch v3.6?

However, I tried to figure out whether something was wrong with the buffering middleware causing the issue, but on my side the defaults look good.
Did you tried to reproduce the issue?

Comment thread docs/content/reference/routing-configuration/http/middlewares/buffering.md Outdated
Comment thread docs/content/reference/routing-configuration/http/middlewares/buffering.md Outdated
Comment thread docs/content/reference/routing-configuration/http/middlewares/buffering.md Outdated
@amazon7737
amazon7737 force-pushed the docs/11323-buffering-defaults branch from 7a875f8 to def2e74 Compare July 3, 2026 09:48
@amazon7737
amazon7737 changed the base branch from v3.7 to v3.6 July 3, 2026 09:49
@amazon7737

Copy link
Copy Markdown
Collaborator Author

I reviewed your pull request and added some comments. As this pull request is a fix, could you rebase it on branch v3.6?

However, I tried to figure out whether something was wrong with the buffering middleware causing the issue, but on my side the defaults look good. Did you tried to reproduce the issue?

Hello @kevinpollet,

No, I did not reproduce it in the reporter's exact environment.

What I checked locally was narrower. With a temporary focused Go test against v3.1.2, I verified that adding the buffering middleware with maxRequestBodyBytes=0 keeps the request size unlimited, but still changes how the request is forwarded upstream.

Without buffering, the upstream received the large request as chunked. With buffering enabled, the upstream received it with a fixed Content-Length.

So the intent of this PR was to document that buffering side effect. I will update the wording based on your comments.

Comment thread docs/content/reference/routing-configuration/http/middlewares/buffering.md Outdated

@kevinpollet kevinpollet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@rtribotte rtribotte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@traefiker
traefiker force-pushed the docs/11323-buffering-defaults branch from 221562b to 5eb593d Compare July 6, 2026 07:40
@traefiker
traefiker merged commit 18fbd82 into traefik:v3.6 Jul 6, 2026
5 checks passed
JuliusFreudenberger pushed a commit to JuliusFreudenberger/nix-config that referenced this pull request Jul 9, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [traefik](https://github.com/containous/traefik) | patch | `v3.7.6` → `v3.7.7` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/12) for more information.

---

### Release Notes

<details>
<summary>containous/traefik (traefik)</summary>

### [`v3.7.7`](https://github.com/traefik/traefik/releases/tag/v3.7.7)

[Compare Source](traefik/traefik@v3.7.7...v3.7.7)

**Important:** Please read the [migration guide](https://doc.traefik.io/traefik/v3.7/migrate/v3/#v377).

**Bug fixes:**

- **\[middleware, k8s/ingress-nginx]** Add app-root middleware with nginx variable interpolation ([#&#8203;13398](traefik/traefik#13398) [@&#8203;dfeinblatt](https://github.com/dfeinblatt))
- **\[rules]** Fix consistency between HostSNI(*) and Host(*) ([#&#8203;13460](traefik/traefik#13460) [@&#8203;juliens](https://github.com/juliens))
- **\[k8s, k8s/gatewayapi]** Fix ExtensionRef filters on backendRefs to resolve against the HTTPRoute namespace ([#&#8203;13462](traefik/traefik#13462) [@&#8203;gndz07](https://github.com/gndz07))
- **\[middleware]** Fix handle empty unknown-length bodies in mirroring ([#&#8203;13399](traefik/traefik#13399) [@&#8203;amazon7737](https://github.com/amazon7737))
- **\[k8s/crd]** Fix cross-provider ref check for TCP ServersTransport in Kubernetes CRD provider ([#&#8203;13458](traefik/traefik#13458) [@&#8203;gndz07](https://github.com/gndz07))
- **\[middleware]** Sanitize replaced path in ReplacePathRegex middleware ([#&#8203;13466](traefik/traefik#13466) [@&#8203;kevinpollet](https://github.com/kevinpollet))
- **\[acme]** Bump software.sslmate.com/src/go-pkcs12 to v0.7.3 ([#&#8203;13477](traefik/traefik#13477) [@&#8203;rtribotte](https://github.com/rtribotte))
- **\[otel]** Bump go.opentelemetry.io/otel to v1.44.0 ([#&#8203;13478](traefik/traefik#13478) [@&#8203;rtribotte](https://github.com/rtribotte))
- **\[k8s]** Fix panic when endpointslice port value or name is nil ([#&#8203;13481](traefik/traefik#13481) [@&#8203;kevinpollet](https://github.com/kevinpollet))

**Documentation:**

- Fix version in migration guide ([#&#8203;13434](traefik/traefik#13434) [@&#8203;kevinpollet](https://github.com/kevinpollet))
- Fix changelog v2.11.51 ([#&#8203;13430](traefik/traefik#13430) [@&#8203;mmatur](https://github.com/mmatur))
- Add v3.7 to supported version docs ([#&#8203;13118](traefik/traefik#13118) [@&#8203;jnoordsij](https://github.com/jnoordsij))
- Fix some function names in comments ([#&#8203;13443](traefik/traefik#13443) [@&#8203;blackflytech](https://github.com/blackflytech))
- Add [@&#8203;nandorKollar](https://github.com/nandorKollar) as a current maintainer ([#&#8203;13451](traefik/traefik#13451) [@&#8203;emilevauge](https://github.com/emilevauge))
- Add [@&#8203;amazon7737](https://github.com/amazon7737) as a current maintainer ([#&#8203;13450](traefik/traefik#13450) [@&#8203;emilevauge](https://github.com/emilevauge))
- **\[middleware]** Clarify buffering middleware defaults ([#&#8203;13401](traefik/traefik#13401) [@&#8203;amazon7737](https://github.com/amazon7737))
- Fix grammar in TLS, TCP service, and routing reference docs ([#&#8203;13461](traefik/traefik#13461) [@&#8203;almightymoon](https://github.com/almightymoon))
- Fix X-Forwarded-Prefix documentation for dashboard redirection ([#&#8203;13472](traefik/traefik#13472) [@&#8203;kevinpollet](https://github.com/kevinpollet))

### [`v3.7.7`](https://github.com/traefik/traefik/releases/tag/v3.7.7)

[Compare Source](traefik/traefik@v3.7.6...v3.7.7)

**Important:** Please read the [migration guide](https://doc.traefik.io/traefik/v3.7/migrate/v3/#v377).

**Bug fixes:**

- **\[middleware, k8s/ingress-nginx]** Add app-root middleware with nginx variable interpolation ([#&#8203;13398](traefik/traefik#13398) [@&#8203;dfeinblatt](https://github.com/dfeinblatt))
- **\[rules]** Fix consistency between HostSNI(*) and Host(*) ([#&#8203;13460](traefik/traefik#13460) [@&#8203;juliens](https://github.com/juliens))
- **\[k8s, k8s/gatewayapi]** Fix ExtensionRef filters on backendRefs to resolve against the HTTPRoute namespace ([#&#8203;13462](traefik/traefik#13462) [@&#8203;gndz07](https://github.com/gndz07))
- **\[middleware]** Fix handle empty unknown-length bodies in mirroring ([#&#8203;13399](traefik/traefik#13399) [@&#8203;amazon7737](https://github.com/amazon7737))
- **\[k8s/crd]** Fix cross-provider ref check for TCP ServersTransport in Kubernetes CRD provider ([#&#8203;13458](traefik/traefik#13458) [@&#8203;gndz07](https://github.com/gndz07))
- **\[middleware]** Sanitize replaced path in ReplacePathRegex middleware ([#&#8203;13466](traefik/traefik#13466) [@&#8203;kevinpollet](https://github.com/kevinpollet))
- **\[acme]** Bump software.sslmate.com/src/go-pkcs12 to v0.7.3 ([#&#8203;13477](traefik/traefik#13477) [@&#8203;rtribotte](https://github.com/rtribotte))
- **\[otel]** Bump go.opentelemetry.io/otel to v1.44.0 ([#&#8203;13478](traefik/traefik#13478) [@&#8203;rtribotte](https://github.com/rtribotte))
- **\[k8s]** Fix panic when endpointslice port value or name is nil ([#&#8203;13481](traefik/traefik#13481) [@&#8203;kevinpollet](https://github.com/kevinpollet))

**Documentation:**

- Fix version in migration guide ([#&#8203;13434](traefik/traefik#13434) [@&#8203;kevinpollet](https://github.com/kevinpollet))
- Fix changelog v2.11.51 ([#&#8203;13430](traefik/traefik#13430) [@&#8203;mmatur](https://github.com/mmatur))
- Add v3.7 to supported version docs ([#&#8203;13118](traefik/traefik#13118) [@&#8203;jnoordsij](https://github.com/jnoordsij))
- Fix some function names in comments ([#&#8203;13443](traefik/traefik#13443) [@&#8203;blackflytech](https://github.com/blackflytech))
- Add [@&#8203;nandorKollar](https://github.com/nandorKollar) as a current maintainer ([#&#8203;13451](traefik/traefik#13451) [@&#8203;emilevauge](https://github.com/emilevauge))
- Add [@&#8203;amazon7737](https://github.com/amazon7737) as a current maintainer ([#&#8203;13450](traefik/traefik#13450) [@&#8203;emilevauge](https://github.com/emilevauge))
- **\[middleware]** Clarify buffering middleware defaults ([#&#8203;13401](traefik/traefik#13401) [@&#8203;amazon7737](https://github.com/amazon7737))
- Fix grammar in TLS, TCP service, and routing reference docs ([#&#8203;13461](traefik/traefik#13461) [@&#8203;almightymoon](https://github.com/almightymoon))
- Fix X-Forwarded-Prefix documentation for dashboard redirection ([#&#8203;13472](traefik/traefik#13472) [@&#8203;kevinpollet](https://github.com/kevinpollet))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.jfreudenberger.de/JuliusFreudenberger/nix-config/pulls/18
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants