首页 > 其他 > 详细

nginx ssi 模块

时间:2017-06-01 11:51:55      阅读:296      评论:0      收藏:0      [点我收藏+]

在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使其生效

nginx ssi 模块

原文:http://www.cnblogs.com/yangmingyu/p/6928026.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!