ssi_value_length

The ssi_value_length directive sets the maximum size for SSI variable values in bytes.

Syntaxssi_value_length size;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The ssi_value_length directive in NGINX serves to configure the maximum length of Server Side Includes (SSI) variable values. This directive is particularly useful in scenarios where large values may be returned by SSI commands, such as <!--# set var='varname' value='...some value...' -->. By limiting the length of value, server resource usage can be controlled effectively, avoiding scenarios that may lead to excessive memory consumption during processing.

When the ssi_value_length directive is set, its parameter must be a positive integer, which represents the maximum allowed length of an SSI variable value in bytes. If a value longer than this limit is specified, NGINX will truncate it to the allowed length. This behavior can be helpful for preventing overflow issues and ensuring stability in service delivery when handling dynamic content created through SSI processing. Users can set the directive in various contexts including http, server, or location blocks, allowing for flexibility in configuration.

Overall, proper use of the ssi_value_length directive can enhance performance while ensuring that the content generated through SSI processing remains manageable. It is essential, however, to choose an appropriate value according to the application's requirements, preserving the integrity of the data while optimizing performance.

Config Example

http {
    ssi_value_length 128;
    server {
        location / {
            ssi on;
        }
    }
}

Setting the value too low may truncate variable values unexpectedly.

Neglecting to configure this directive can lead to excessive resource consumption when large SSI variable values are processed.

← Back to all directives