### 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