ChsHttpSsiModule
Contents |
ngx_http_ssi_module
姝ゆā鍧楀鐞嗘湇鍔″櫒绔寘鍚枃浠(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 鍦╨ocation浣滅敤鍩熶腑灏嗗惎鐢⊿SI鏂囦欢澶勭悊.
ssi_silent_errors
璇硶: ssi_silent_errors [on|off]
榛樿鍊: ssi_silent_errors off
浣滅敤鍩: http, server, location
鍦ㄥ鐞哠SI鏂囦欢鍑洪敊鏃朵笉杈撳嚭閿欒鎻愮ず:"[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... -->
鏀寔鐨凷SI 鍛戒护濡備笅:
-
block
鈥 command describes the block, which can be used as a silencer in commandinclude
. Inside the block there can be commandsSSI
. - name 鈥 the name of the block. For example:
-
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:
-
echo
- print a variable - var 鈥 the name of the variable
- default - if the variable is empty, display this string. Defaults to "none". Example:
-
if
/elif
/else
/endif
鈥 conditionally include text or other directives. Usage:
- ...
- ...
- ...
- </pre> 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.
- 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
- 褰撳墠鐨凣MT鏃堕棿. 閰嶇疆閫夐」"timefmt"鎺у埗鏍煎紡.