scgi_pass_request_body

The scgi_pass_request_body directive controls whether the request body is sent to the SCGI server when using SCGI proxying.

Syntaxscgi_pass_request_body on | off;
Defaulton
Contexthttp, server, location
Argumentsflag

Description

The scgi_pass_request_body directive is a flag used in conjunction with SCGI server configurations. When enabled, this directive indicates that the entire request body should be forwarded to the SCGI server specified by the scgi_pass directive. If the directive is set to 'off', the request body will not be forwarded, which may be beneficial in cases where the body of the request is not needed by the SCGI backend, thus conserving resources and bandwidth.

This directive can be employed in the context of http, server, or location blocks. It accepts a parameter, which is a flag, meaning you can set it to either on (to pass the request body) or off (to not pass it). The default behavior when this directive is not specified is to pass the request body based on the context of the request and the configuration of other related directives.

When utilizing the directive, careful consideration should be given to the requirements of the SCGI application. Some SCGI applications may need the request body for their processing, while others might not. Misconfiguration could lead to improper request handling at the SCGI backend, causing issues with data processing or response generation.

Config Example

location /scgi {
    scgi_pass http://backend;
    scgi_pass_request_body on;
}

Setting scgi_pass_request_body to off may lead to unexpected behavior if the SCGI application expects a request body.

Ensure compatibility of SCGI applications with respect to handling of request bodies before toggling this directive.

← Back to all directives