将想要的状态,
以“彩色”在大脑中呈现!

ngx_http_ssi_module

ngx_http_ssi_module

ngx_http_ssi_module 模块是一个过滤器,在经过它的响应中处理 SSI(服务器端包含)命令。目前,支持的 SSI 命令列表并不完整。

示例配置

location / {
    ssi on;
    ...
}

指令

ssi

- 说明
语法 ssi on | off;
默认 ssi off;
上下文 http、server、location、location 中的 if

启用或禁用处理响应中的 SSI 命令。

ssi_last_modified

- 说明
语法 ssi_last_modified on | off;
默认 ssi_last_modified off;
上下文 http、server、location
提示 该指令在 1.5.1 版本中出现

允许在 SSI 处理期间保留原始响应中的 Last-Modified 头字段,以便于响应缓存。

默认情况下,在处理过程中修改响应内容时会删除头字段,并且可能包含动态生成的元素或与原始响应无关的部分。

ssi_min_file_chunk

- 说明
语法 ssi_min_file_chunk size;
默认 ssi_min_file_chunk 1k;
上下文 http、server、location

设置响应存储在磁盘上的部分的最小大小(size),从使用 sendfile 发送它们起生效。

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 ...;
默认 ssi_types text/html;
上下文 http、server、location

除了 text/html 之外,还可以指定在其他 MIME 类型的响应中处理 SSI 命令。特殊值 * 匹配任何 MIME 类型(0.8.29)。

ssi_value_length

- 说明
语法 ssi_value_length length;
默认 ssi_value_length 256;
上下文 http、server、location

设置 SSI 命令中参数值的最大长度。

SSI 命令

SSI 命令的通用格式:

<!--# command parameter1=value1 parameter2=value2 ... -->

支持以下命令:

内嵌变量

ngx_http_ssi_module 模块支持两个内嵌变量:

  • $date_local

    当地时区的当前时间。该格式由 config 命令和 timefmt 参数设置。

  • $date_gmt

    格林威治标准时间形式的当前时间,该格式由 config 命令和 timefmt 参数设置。

赞(0)
未经允许不得转载:自猿其说 » ngx_http_ssi_module

评论 抢沙发

评论前必须登录!

 

聚合实用在线工具

前往在线工具