Nginx SSI 设置
来源:互联网 发布:linux 关闭系统 编辑:程序博客网 时间:2024/05/16 18:03
什么是SSI
Server Side Include,通常称为服务器端嵌入,是一种类似于ASP的基于服务器的网页制作技术。大多数(尤其是基于Unix平台)的WEB服务器如Netscape Enterprise Server等均支持SSI命令。
为什么要用SSI
用个例子来说明,一个静态化的页面中,需要嵌入一小块实时变化的内容,。例如首页,大部分的页面内容需要缓存但是用户登录后的个人信息是动态信息,不能缓存。那么如何解决这个”页面部分缓存”问题,利用SSI就可以解决,在首页的静态页面中嵌入个人信息的动态页,由于是服务器端的嵌入,所以用户浏览的时候都是一个嵌入后的页面。
nginx配置SSI
主要是三个参数,ssi,ssi_silent_errors和ssi_types,均可以放在http,server和location的作用域下。
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
页面上配置
- <!–# include file=”/m/2013/4/15/index_top.html”–>
或
- <!–# include virtual=”/m/2013/4/15/index_top.html”–>
示例
1.开启shtml后缀的文件名支持ssi
- server{
- ……
- ssi on;
- ssi_silent_errors on;
- ssi_types text/shtml;
- }
2.开启html后缀的文件名支持ssi
- server{
- ……
- ssi on;
- ssi_silent_errors on;
- }
3.在zt目录下开启html后缀的文件名支持ssi
- server{
- ……
- location /hx/{
- ssi on;
- ssi_silent_errors on;
- }
- }
来源:http://iqbon.iteye.com/blog/1882319
- Nginx ssi 设置
- Nginx SSI 设置
- Nginx SSI 设置
- Nginx配置SSI
- Nginx配置SSI
- Nginx+ssi结合配置
- Nginx配置服务器SSI
- Nginx结合ssi
- 【Nginx 配置】 SSI
- 【Linux】Nginx SSI 配置
- nginx的SSI
- Nginx配置SSI
- Nginx 配置 SSI 的方法
- 让 Nginx 支持 SSI (Server Side Includes)
- nginx配置支持ssi不起作用问题解决办法
- nginx中SSI问题的研究
- SSI
- ssi
- 613. Shortest Distance in a Line--ABS() and MIN()
- Linux网络编程--sendfile零拷贝高效率发送文件
- Hat’s Words
- 文件在本地服务器不留痕迹的下载
- e-Coins POJ
- Nginx SSI 设置
- LeetCode---2.Two Sum
- HDU-4238-You Are the One (区间DP)
- Numpy 花式索引
- 1598
- hdu 6035 Colorful Tree(dfs)
- 如何做读书笔记——《钱钟书如何做读书笔记》有感
- 二分法查找C语言实现
- 二分