=encoding utf-8 =head1 NAME ngx_http_ssi_module - Module ngx_http_ssi_module =head1 The C module is a filter that processes SSI (Server Side Includes) commands in responses passing through it. Currently, the list of supported SSI commands is incomplete. =head1 Example Configuration location / { ssi on; ... } =head1 Directives =head2 ssi B ssi I E C> B I B I B I B I B I Enables or disables processing of SSI commands in responses. =head2 ssi_last_modified B ssi_last_modified I E C> B I B I B I B I This directive appeared in version 1.5.1. Allows preserving the C header field from the original response during SSI processing to facilitate response caching. By default, the header field is removed as contents of the response are modified during processing and may contain dynamically generated elements or parts that are changed independently of the original response. =head2 ssi_min_file_chunk B ssi_min_file_chunk I> B I<1k> B I B I B I Sets the minimum I> for parts of a response stored on disk, starting from which it makes sense to send them using L. =head2 ssi_silent_errors B ssi_silent_errors I E C> B I B I B I B I If enabled, suppresses the output of the “C<[an error occurred while processing the directive]>” string if an error occurred during SSI processing. =head2 ssi_types B ssi_types I> ...> B Ihtml> B I B I B I Enables processing of SSI commands in responses with the specified MIME types in addition to “Chtml>”. The special value “C<*>” matches any MIME type (0.8.29). =head2 ssi_value_length B ssi_value_length I>> B I<256> B I B I B I Sets the maximum length of parameter values in SSI commands. =head1 SSI Commands SSI commands have the following generic format: The following commands are supported: =over =item C Defines a block that can be used as a stub in the C command. The block can contain other SSI commands. The command has the following parameter: =over =item C block name. =back Example: stub =item C Sets some parameters used during SSI processing, namely: =over =item C a string that is output if an error occurs during SSI processing. By default, the following string is output: [an error occurred while processing the directive] =item C a format string passed to the C function used to output date and time. By default, the following format is used: "%A, %d-%b-%Y %H:%M:%S %Z" The “C<%s>” format is suitable to output time in seconds. =back =item C Outputs the value of a variable. The command has the following parameters: =over =item C the variable name. =item C the encoding method. Possible values include C, C, and C. By default, C is used. =item C a non-standard parameter that sets a string to be output if a variable is undefined. By default, “C” is output. The command replaces the following sequence of commands: no =back =item C Performs a conditional inclusion. The following commands are supported: ... ... ... Only one level of nesting is currently supported. The command has the following parameter: =over =item C expression. An expression can be: =over =item * variable existence check: =item * comparison of a variable with a text: =item * comparison of a variable with a regular expression: =back If a I> contains variables, their values are substituted. A regular expression can contain positional and named captures that can later be used through variables, for example: =back =item C Includes the result of another request into a response. The command has the following parameters: =over =item C specifies an included file, for example: =item C specifies an included request, for example: Several requests specified on one page and processed by proxied or FastCGIEuwsgiESCGI servers run in parallel. If sequential processing is desired, the C parameter should be used. =item C a non-standard parameter that names the block whose content will be output if the included request results in an empty body or if an error occurs during the request processing, for example:   The replacement block content is processed in the included request context. =item C a non-standard parameter that instructs to wait for a request to fully complete before continuing with SSI processing, for example: =item C a non-standard parameter that instructs to write a successful result of request processing to the specified variable, for example: It should be noted that only the results of responses obtained using the L, L, L (1.5.6), L (1.5.6), and L (1.5.6) modules can be written into variables. =back =item C Sets a value of a variable. The command has the following parameters: =over =item C the variable name. =item C the variable value. If an assigned value contains variables, their values are substituted. =back =back =head1 Embedded Variables The C module supports two embedded variables: =over =item C<$date_local> current time in the local time zone. The format is set by the C command with the C parameter. =item C<$date_gmt> current time in GMT. The format is set by the C command with the C parameter. =back