nginx ssi

 

HttpSsiModule
This module provides a filter which processes Server-Side Includes (SSI) in the input. The list of the supported commands for SSI is currently incomplete.
以下是测试环境的配置示例
1、反向代理Server,开启SSI模块,在反向代理location下增加:
       location / {
             #开启SSI模块
             ssi on;
             proxy_intercept_errors on;
             proxy_set_header X-Forwarded-For            $proxy_add_x_forwarded_for;
             proxy_pass http://127.0.0.1:7001;
             error_page 404 =200 /404.html;
             error_page 502 /502.html;
        }

2、确保存在/ssi的location配置
        location /ssi/ {
           alias /app/html/static/;
        }
 
       3、页面使用ssi引用
<!--# include file="/ssi/ssi_test.html" -->
需注意文件的位置:示例ssi_test.html的实际主机的文件位置是 /app/html/static/ssi_test.html

The target of "file" or "virtual" must be a location in the server configuration.

http://wiki.nginx.org/HttpSsiModule 可参考其他使用,例如参数传递

SSI开启后,nginx将不会发送HTTP头信息中的 Last-Modified和Content-Length,所以此类页面可能不会被浏览器缓存

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值