Server Side Include

SSI 是 Server Side Include 的首字母缩略词。包含有嵌入式服务器方包含命令的 HTML 文本。在被传送给浏览器之前,服务器会对 SHTML 文档进行完全地读取、分析以及修改。



在 Nginx 中,开启 SSI 支持非常简单,通过向 nginx.conf 中添加几行设置命令即可实现。



将下面的3行代码添加到 nginx.conf 文件的 http{} 段中,以开启 SSI 模块的支持:
https://blog.csdn.net/m1617641027/article/details/58597297

https://blog.csdn.net/u014131617/article/details/87891085



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的格式:



路径是相对server中root根目录。



http://www.361way.com/nginx-ssi/2606.html



http://nginx.org/en/docs/http/ngx_http_ssi_module.html


Category nginx