ajp_pass_request_body

The `ajp_pass_request_body` directive controls whether the body of the request is forwarded to the AJP server.

Syntaxajp_pass_request_body on | off;
Defaultoff
Contexthttp, server, location
Argumentsflag

Description

The ajp_pass_request_body directive can be enabled or disabled to specify whether the request body should be sent to the AJP (Apache JServ Protocol) server when processing requests in NGINX. Enabling this directive means that any data sent in the body of an HTTP request, such as POST data, will be included in the request forwarded to the AJP backend. Conversely, if it is disabled, the request body will not be forwarded, which may be suitable for scenarios where the backend does not require a request body or when you want to reduce the data sent.

It's important to note that this directive accepts a flag argument, where the state can be set to 'on' or 'off'. By default, this directive does not impose a specific behavior unless explicitly defined. Depending on the interaction with AJP backends, you might want to carefully decide when to forward the request body; for example, if your application requires data submissions through forms, you would want this directive to be enabled. Conversely, disabling it could improve performance in scenarios where the body is superfluous or where only header information is needed for the backend to process requests.

Config Example

location /example {
    ajp_pass_request_body on;
    ajp_pass tomcats;
}

Be mindful of the context in which this directive is used; it should be placed within an http, server, or location block.

Not forwarding the request body might break functionality for certain endpoints that expect data submissions.

← Back to all directives