nginx ssi 模块

在nginx下与SSI配置相关的参数主要有ssi  ssi_sclient_error ssi_types三个。具体的用法如下

复制代码
ssi on
开启ssi支持,默认是off
ssi_silent_errors on
默认值是off,开启后在处理SSI文件出错时不输出错误提示:"[an error occurred while processing the directive] "
ssi_types
默认是ssi_types text/html,所以如果需要htm和html支持,则不需要设置这句,如果需要shtml支持,则需要设置:ssi_types text/shtml
复制代码

SSI引用的格式如下:

SSI的格式:
<!--#include file="foot.html"-->
或
<!--#include virtual="/tx/foot.html"-->
路径是相对server中root根目录。站点的绝对路径

 

例如一个index.html页面里有下面一段

 

<div class="footer">
 <div class="footer_bottom">版权所有 @2011 运维之路www.361way.com 浙ICP备XXXX号</div>
  <div class="footer_bottom" >声明:本站…………………… </div>
</div>

我可以保存为foot.html或者foot.shtml,在index.html引入即可

 

前提reload下ssi使其生效

转载于:https://www.cnblogs.com/yangmingyu/p/6928026.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值