<!-- <include src="public/Header.html"></include> -->
<!-- <include src="public/Footer.html"></include> -->
Nginx配置SSI
如何在nginx上配置SSI
需要的选项主要是以下三个:
ssi: 默认值off,启用ssi时将其设为on
ssi_silent_errors: 默认值off,开启后在处理SSI文件出错时不输出错误提示"[an error occurred while processing the directive]"。
ssi_types: 默认是text/html,所以如果需支持html,则不需要设置这句,如果需要支持shtml则需要设置:ssi_types text/shtml
三个参数可以放在http, server或location作用域下。
location / {
ssi on;
ssi_silent_errors on;
root html;
index index.html index.htm;
}