### HttpSSI模块
此模块处理服务器端包含文件(ssi)的处理. 列表中的命令当前并未完全支持.
__配置示例__
~~~
location / {
: ssi on;
}
~~~
### Directives
- [#ssi ssi]
- [#ssi_silent_errors ssi_silent_errors]
- [#ssi_types ssi_types]
- [#ssi_value_length ssi_value_length]
### ssi
**语法:***ssi [ on | off ]*
**默认值:***ssi off*
**作用域:***http, server, location* 在location作用域中将启用SSI文件处理.
### ssi_silent_errors
**语法:***ssi_silent_errors [on|off]*
**默认值:***ssi_silent_errors off*
**作用域:***http, server, location*
在处理SSI文件出错时不输出错误提示:"[an error occurred while processing the directive] "
### ssi_types
**语法:***ssi_types mime-type [mime-type ...]*
**默认值:***ssi_types text/html*
**作用域:***http, server, location*
Enables SSI processing for MIME-types in addition to "text/html" types.
### ssi_value_length
**语法:***ssi_value_length length*
**默认值:***ssi_value_length 256*
**作用域:***http, server, location*
定义SSI允许使用的参数长度
### SSI 命令
格式示例如下:
~~~
: <!--# command parameter1=value parameter2=value... -->
~~~
支持的SSI 命令如下:
- `block` — command describes the block, which can be used as a silencer in command `include`. Inside the block there can be commands `SSI`.
- *name* — the name of the block. For example:
: <!--# block name="one" --> : the silencer : <!--# endblock --> :
- `config` — assigns some parameters with working SSI.
- *errmsg* — the line, which is derived with the error during the SSI processing. By default, this string is used: "[an error occurred while processing the directive] "
- *timefmt* — the time formatting string, as used in strftime(3). By default, this string is used:
: "%A, %d-%b-%Y %H:%M:%S %Z" : To include time in seconds use the format "%s" as well.
- `echo` - print a variable
- *var* — the name of the variable
- *default* - if the variable is empty, display this string. Defaults to "none". Example:
: <!--# echo var="name" default="no" --> : </code> is the same as <code> : <!--# if expr="$name" --><!--# echo var="name" --><!--# else -->no<!--# endif --> :
- `if / elif / else / endif` — conditionally include text or other directives. Usage:
.........Only one level of nesting is possible.
- *expr* — the expression to evaluate. It can be a variable:
~~~
~~~
<!--# if expr="$name" --></code> A string comparison: <code><!--# if expr="$name = text" --><!--# if expr="$name != text" --></code> Or a regex match: <code><!--# if expr="$name = /text/" --><!--# if expr="$name != /text/" -->Если в text встречаются переменные, то производится подстановка их значений.
- <code>include — include a document from another source.
- *file* — include a file, e.g.
~~~
~~~
: <!--# include file="footer.html" --> :
- *virtual* — include a request, e.g.
<!--# include virtual="/remote/body.php?argument=value" -->Multiple requests will be issued in parallel. If you need them issued sequentially, use the "wait" option.
- *stub* — The name of the block to use as a default if the request is empty or returns an error.
<!--# block name="one" --> <!--# endblock --><!--# include virtual="/remote/body.php?argument=value" stub="one" -->
- *wait* — when set to yes, the rest of the SSI will not be evaluated until the current request is finished. Example:
~~~
~~~
<!--# include virtual="/remote/body.php?argument=value" wait="yes" -->
- `set` - assign a variable.
- var — the variable.
- value — its value. If it contains variable names, these will be evaluated.
### 内置变量
ngx_http_ssi_module 支持两种内置变量:
- `$date_local` - 当前的本地时区时间.配置选项"timefmt"控制格式.
- `$date_gmt` - 当前的GMT时间. 配置选项"timefmt"控制格式.
### 参考
[Original Documentation](http://sysoev.ru/nginx/docs/http/ngx_http_ssi_module.html "http://sysoev.ru/nginx/docs/http/ngx_http_ssi_module.html")
- 主要文档
- Nginx功能概述
- 为什么选择Nginx
- Nginx安装
- 运行和控制Nginx
- 配置符号参考
- 优化 Nginx
- 常见问题(FAQ)
- 调试 nginx
- 核心模块
- Nginx主模块
- Nginx事件模块
- 基本模块
- http核心模块
- HttpIndex模块
- HttpAccess模块
- HttpAuthBasic模块
- HttpAutoindex模块
- Browser模块
- Charset模块
- HttpEmptyGif模块
- HttpFcgi模块
- Geo模块
- HttpGzip模块
- HttpHeaders模块
- HttpIndex模块
- HttpReferer模块
- HttpLimit zone
- HttpLimitReqest模块
- HttpLog模块
- map
- Memcached
- HttpProxy模块
- HttpRewrite模块
- HttpSSI模块
- HttpUserId
- 其他模块
- Addition模块
- EmbeddedPerl
- flv
- HttpGzipStatic
- RandomIndex
- HttpGeoIP
- HttpRealIp
- HttpSSL
- StubStatus模块
- HttpSubstitution
- HttpDav模块
- GooglePerftools
- HttpXSLT
- HttpSecureLink
- HttpImageFilter
- mail模块
- MailCore
- MailAuth
- MailProxy
- MailSSL
- 安装
- nginx在windows上的安装
- nginx在freebsd上的安装
- nginx在ubuntu上的安装
- nginx在fedora上的安装
- nginx php-fpm安装配置
- 配置示例和方法
- 完整例子
- 完整例子2
- 虚拟主机
- 负载均衡
- nginx防盗链
- HWLoadbalancerCheckErrors