# HG changeset patch # User Ruslan Ermilov # Date 1328612485 0 # Node ID a56540cdcea5805e32abe740621212098d9fab44 # Parent 8548b80a455274d6a132b0f784a86390d2b41f08 English translation of ngx_http_ssi_module. diff --git a/xml/en/GNUmakefile b/xml/en/GNUmakefile --- a/xml/en/GNUmakefile +++ b/xml/en/GNUmakefile @@ -75,6 +75,7 @@ REFS = \ http/ngx_http_rewrite_module \ http/ngx_http_secure_link_module \ http/ngx_http_split_clients_module \ + http/ngx_http_ssi_module \ http/ngx_http_ssl_module \ http/ngx_http_sub_module \ http/ngx_http_upstream_module \ diff --git a/xml/en/docs/http/ngx_http_ssi_module.xml b/xml/en/docs/http/ngx_http_ssi_module.xml new file mode 100644 --- /dev/null +++ b/xml/en/docs/http/ngx_http_ssi_module.xml @@ -0,0 +1,373 @@ + + + + + + +
+ + +The ngx_http_ssi_module 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. + + +
+ + +
+ + + +location / { + ssi on; + ... +} + + + +
+ + +
+ + +on | off +off +http +server +location +if in location + + +Enables or disables processing of SSI commands in responses. + + + + + + +on | off +off +http +server +location + + +Allows to suppress output of the string +“[an error occurred while processing the directive]” +if an error occurred during SSI processing. + + + + + + +mime-type ... +text/html +http +server +location + + +Enables processing of SSI commands in responses with the specified MIME types +in addition to “text/html”. + + + + +
+ + +
+ + +SSI commands have the following generic format: + +<!--# command parameter1=value1 parameter2=value2 ... --> + + + + +The following commands are supported: + + +block + +Defines a block that can be used as a stub +in the include command. +The block can contain other SSI commands. +The command has the following parameter: + + +name + +block name. + + + +Example: + +<!--# block name="one" --> +stub +<!--# endblock --> + + + + + +config + +Sets some parameters used during SSI processing, namely: + + +errmsg + +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] + + + +timefmt + +a format string passed to the strftime function +used to output date and time. +By default, the following format is used: + +"%A, %d-%b-%Y %H:%M:%S %Z" + +The “%s” format is suitable to output time in seconds. + + + + + + +echo + +Outputs the value of a variable. +The command has the following parameters: + + +var + +variable name. + + +encoding + +encoding method. +Possible values include none, url, and +entity. +By default, entity is used. + + +default + +non-standard parameter that sets a string to be output +if a variable is undefined. +By default, “none” is output. +The command + +<!--# echo var="name" default="no" --> + +replaces the following sequence of commands: + +<!--# if expr="$name" --><!--# echo var="name" --><!--# + else -->no<!--# endif --> + + + + + + + +if + +Performs a conditional inclusion. +The following commands are supported: + +<!--# if expr="..." --> +... +<!--# elif expr="..." --> +... +<!--# else --> +... +<!--# endif --> + +Only one level of nesting is currently supported. +The command has the following parameter: + + +expr + +expression. +An expression can be: + + + + +variable existence check: + +<!--# if expr="$name" --> + + + + +comparison of a variable with a text: + +<!--# if expr="$name = text" --> +<!--# if expr="$name != text" --> + + + + +comparison of a variable with a regular expression: + +<!--# if expr="$name = /text/" --> +<!--# if expr="$name != /text/" --> + + + + +If a text contains variables, +their values are substituted. +A regular expression can contain positional and named captures +that can later be used through variables, for example: + +<!--# if expr="$name = /(.+)@(?P<domain>.+)/" --> + <!--# echo var="1" --> + <!--# echo var="domain" --> +<!--# endif --> + + + + + + + +include + +Includes the result of another request into a response. +The command has the following parameters: + + +file + +specifies an included file, for example: + +<!--# include file="footer.html" --> + + + +virtual + +specifies an included request, for example: + +<!--# include virtual="/remote/body.php?argument=value" --> + +Several requests specified on one page and processed by proxied or +FastCGI servers run in parallel. +If sequential processing is desired, the wait +parameter should be used. + + +stub + +non-standard parameter that names the block whose +content will be output if an included request results in an empty +body or if an error occurs during request processing, for example: + +<!--# block name="one" -->&nbsp;<!--# endblock --> +<!--# include virtual="/remote/body.php?argument=value" stub="one" --> + +The replacement block content is processed in the included request context. + + +wait + +non-standard parameter that instructs to wait for a request to fully +complete before continuing with SSI processing, for example: + +<!--# include virtual="/remote/body.php?argument=value" wait="yes" --> + + + +set + +non-standard parameter that instructs to write a successful result +of request processing to the specified variable, +for example: + +<!--# include virtual="/remote/body.php?argument=value" set="one" --> + +It should be noted that only the results of responses obtained using the +ngx_http_proxy_module and +ngx_http_memcached_module +modules can be written into variables. + + + + + + + +set + +Sets a value of a variable. +The command has the following parameters: + + +var + +variable name. + + +value + +variable value. +If an assigned value contains variables, +their values are substituted. + + + + + + + + +
+ + +
+ + +The ngx_http_ssi_module module supports +two embedded variables: + + +$date_local + +current time in local time zone. +The format is set by the config command +with the timefmt parameter. + + +$date_gmt + +current time in GMT. +The format is set by the config command +with the timefmt parameter. + + + + + +
+ +
diff --git a/xml/en/docs/index.xml b/xml/en/docs/index.xml --- a/xml/en/docs/index.xml +++ b/xml/en/docs/index.xml @@ -220,6 +220,11 @@ ngx_http_split_clients_module + +ngx_http_ssi_module + + + ngx_http_ssl_module diff --git a/xml/en/index.xml b/xml/en/index.xml --- a/xml/en/index.xml +++ b/xml/en/index.xml @@ -69,7 +69,7 @@ Filters include gzipping, byte ranges, chunked responses, XSLT, -SSI, +SSI, and image transformation filter. Multiple SSI inclusions within a single page can be processed in