Skip to main content

proxy-control

Controls request buffering for the upstream.

Category TrafficAdd it to Route, Service, Consumer, Consumer group, Global rule, Plugin configEngine plugin proxy-controlPriority 21990

What it does​

proxy-control decides how a request body reaches the backend. The gateway reads every request body in full before it calls the backend, and with Request buffering off it passes the body on as it arrives instead.

Turning the row on changes nothing, since the gateway already reads every body in full. The plugin is worth adding only to turn buffering off.

When to use it​

  • Partners upload large order files through the partner portal, and the backend should start reading each one before the last byte arrives.
  • A backend that accepts a long stream of order events in one request body and acts on each as it comes.
  • Uploads too large to hold in full on the gateway while they arrive.

Not for passing the backend's answer to the client as it arrives — see proxy-buffering (Controls response buffering from the upstream), the largest request body a route takes — see client-control (Controls the client request body size) or refusing a request whose body does not match a schema — see request-validation (Validates request headers and body against a JSON Schema).

Set it up​

Pass a large upload straight to the backend without buffering it​

Turn off Request buffering.

proxy-control · as the console saves it
{
"request_buffering": false
}

Things to know​

  • Request buffering — The gateway already reads every request body in full before it calls the upstream, so the only thing this row changes is turning that off.
  • Request buffering — The row is a switch: the text false in quotes is refused when you save.
  • AdviceTurn buffering off only on the routes that take large or long uploads, and leave the others as they are.

Settings​

The fields as the console shows them, section by section.

Request bufferingrequest_bufferingbooleandefault true

Off, the request body is passed to the upstream as it arrives instead of being read in full first.

Every plugin also has Enabled, Priority, Filter, Error response and Pre-function: see Plugin execution settings.

G8 dev · Apache APISIX® 3.19.0
Apache, Apache APISIX and APISIX are trademarks of The Apache Software Foundation.
Facts
Category
Traffic
Add it to
Route, Service, Consumer, Consumer group, Global rule, Plugin config
Engine plugin
proxy-control
Priority
21990