nginx中,启动SSI后,ssi_silent_errors参数为什么不起作用?

berg369 2017-05-05 09:52:47
在nginx上配置SSI
需要的选项主要是以下三个:
ssi: 默认值off,启用ssi时将其设为on
ssi_silent_errors: 默认值off,开启后在处理SSI文件出错时不输出错误提示"[an error occurred while processing the directive]"。
ssi_types: 默认是text/html

我启动了ssi,html页面中,以下方式引入了:<!--#include file="/aa.html" -->
aa.html文件并不存在,我期望出现[an error occurred while processing the directive],但是却出现了404 Not Found,无论ssi_silent_errors值是什么,都显示404 Not Found

我的目标是希望当ssi引入的资源出现404、500、503、504等错误时,不显示任何错误提示,空白即可,不影响静态html的显示,但是当非ssi方式正常访问链接时,如有404、50x等错误则正常显示错误页面。请问如何实现呢?
...全文
240 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧