HttpSsiModule

WARNING: this article is obsoleted. Please refer to http://nginx.org/en/docs/ for the latest official documentation.

= Synopsis = This module provides a filter which processes Server-Side Includes (SSI) in the input. The list of the supported commands for SSI is currently incomplete.

Example location / { ssi on; }

= Directives =

ssi


Enables SSI processing.

Note that when SSI is enabled the Last-Modified and Content-Length headers are not sent.

ssi_silent_errors


Doesn't output "[an error occurred while processing the directive] ", if an error occurs while processing the SSI.

ssi_types


Enables SSI processing for MIME-types in addition to "text/html" types.

ssi_value_length
syntax: ssi_value_length length

default: ssi_value_length 256

context: http, server, location

Defines the allowed length of values for parameters used in SSI.

= SSI Commands =

Instruction format is the following:

Note that the hash ('#') must immediately follow the two dashes ('--').

The supported SSI commands are listed below.

block
This command creates a block, which can be used as a silencer in command. Inside the block there can be other SSI commands.

the silencer
 * — the name of the block. For example:

config
Assigns some configuration parameter for SSI.

"%A, %d-%b-%Y %H:%M:%S %Z" To include time in seconds use the format "%s" as well.
 * — the line which is used as the error during SSI processing. By default, this string is used: "[an error occurred while processing the directive] "
 * — the time formatting string, as used in strftime(3). By default, this string is used:

echo
Print a variable.

is the same as no
 * — the name of the variable
 * — the escape of the variable, there are,  ,  . Defaults to
 * - if the variable is empty, display this string. Defaults to "none". Example:

if / elif / else / endif
Conditionally include text or other directives. Usage:

... ...  ... Only one level of nesting is possible. A string comparison: Or a regex match: If there are variables in the text, they will have their values substituted.
 * expr — the expression to evaluate. It can be a variable:

include
Include a document from another source.


 * — include a file, e.g.
 * — include a request, e.g.

The target of "file" or "virtual" must be a location in the server configuration.

The distinction between "file" and "virtual" is mostly historical. "file" is the same as "virtual" with implied "wait" option. At one point the directives mirrored the Apache equivalents but now they are basically the same operation. Both can handle a URI and both can serve a static file.

Multiple requests will be issued in parallel. If you need them issued sequentially, use the "wait" option.
 * — The name of the block to use as a default if the request is empty or returns an error.
 * — when set to yes, the rest of the SSI will not be evaluated until the current request is finished. Example:
 * — when set to a variable name, the output of the SSI will not be sent to the output, instead the output is set to the variable. Example:

set
Assign a variable.


 * — the variable.
 * — its value. If it contains variable names, these will be evaluated.

= Variables =

$date_local
The current time in the local timezone. The config option "timefmt" controls the format.

$date_gmt
The current time in GMT. The config option "timefmt" controls the format.

= References = Original Documentation