Appearance
ssi
http://nginx.org/en/docs/http/ngx_http_ssi_module.html
配置项
ssi on | off;
开关
ssi_min_file_chunk 1k;
磁盘存储并使用 sendfile 的文件的最小值
ssi_last_modified on | off;
是否允许在 SSI 处理期间保留原始响应的 Last Modified 字段,以方便缓存。
ssi_silent_errors on | off;
是否在页面中显示错误,如命令写错时。
ssi_value_length 256;
限制参数的最大长度
ssi_types text/html;
设置支持的 mime 类型
nginx
location / {
# 开启文件合并
ssi on;
root html;
index index.html;
}把公共区域提取出来,通过添加注释会自动合并到页面中。
html
<!--# include file="header.html" -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>body</h1>
</body>
</html>
<!--# include file="footer.html" -->